Skip to content

Commit d773f11

Browse files
committed
SortOptions should regain it's NS
rename SortOptions to NSSortOptions
1 parent bfc661d commit d773f11

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Diff for: Foundation/NSArray.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ open class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCo
474474
return result
475475
}
476476

477-
internal func sortedArrayFromRange(_ range: NSRange, options: SortOptions, usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] {
477+
internal func sortedArrayFromRange(_ range: NSRange, options: NSSortOptions, usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] {
478478
// The sort options are not available. We use the Array's sorting algorithm. It is not stable neither concurrent.
479479
guard options.isEmpty else {
480480
NSUnimplemented()
@@ -495,7 +495,7 @@ open class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCo
495495
return sortedArrayFromRange(NSMakeRange(0, count), options: [], usingComparator: cmptr)
496496
}
497497

498-
open func sortedArray(options opts: SortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] {
498+
open func sortedArray(options opts: NSSortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] {
499499
return sortedArrayFromRange(NSMakeRange(0, count), options: opts, usingComparator: cmptr)
500500
}
501501

@@ -837,7 +837,7 @@ open class NSMutableArray : NSArray {
837837
self.sortWithOptions(options: [], usingComparator: cmptr)
838838
}
839839

840-
open func sortWithOptions(options opts: SortOptions, usingComparator cmptr: Comparator) {
840+
open func sortWithOptions(options opts: NSSortOptions, usingComparator cmptr: Comparator) {
841841
self.setArray(self.sortedArray(options: opts, usingComparator: cmptr))
842842
}
843843

Diff for: Foundation/NSDictionary.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ open class NSDictionary : NSObject, NSCopying, NSMutableCopying, NSSecureCoding,
447447
return keysSortedByValue(options: [], usingComparator: cmptr)
448448
}
449449

450-
open func keysSortedByValue(options opts: SortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] {
450+
open func keysSortedByValue(options opts: NSSortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] {
451451
let sorted = allKeys.sorted { lhs, rhs in
452452
return cmptr(lhs, rhs) == .orderedSame
453453
}

Diff for: Foundation/NSObjCRuntime.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ public enum NSQualityOfService : Int {
171171
case `default`
172172
}
173173

174-
public struct SortOptions: OptionSet {
174+
public struct NSSortOptions: OptionSet {
175175
public let rawValue : UInt
176176
public init(rawValue: UInt) { self.rawValue = rawValue }
177177

178-
public static let concurrent = SortOptions(rawValue: UInt(1 << 0))
179-
public static let stable = SortOptions(rawValue: UInt(1 << 4))
178+
public static let concurrent = NSSortOptions(rawValue: UInt(1 << 0))
179+
public static let stable = NSSortOptions(rawValue: UInt(1 << 4))
180180
}
181181

182182
public struct NSEnumerationOptions: OptionSet {

Diff for: Foundation/NSOrderedSet.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ extension NSOrderedSet {
265265
open func index(of object: Any, inSortedRange range: NSRange, options opts: NSBinarySearchingOptions = [], usingComparator cmp: (Any, Any) -> ComparisonResult) -> Int { NSUnimplemented() } // binary search
266266

267267
open func sortedArray(comparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] { NSUnimplemented() }
268-
open func sortedArray(options opts: SortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] { NSUnimplemented() }
268+
open func sortedArray(options opts: NSSortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) -> [Any] { NSUnimplemented() }
269269

270270
public func description(withLocale locale: Locale?) -> String { NSUnimplemented() }
271271
public func description(withLocale locale: Locale?, indent level: Int) -> String { NSUnimplemented() }
@@ -528,11 +528,11 @@ extension NSMutableOrderedSet {
528528
sortRange(NSMakeRange(0, count), options: [], usingComparator: cmptr)
529529
}
530530

531-
open func sort(options opts: SortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) {
531+
open func sort(options opts: NSSortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) {
532532
sortRange(NSMakeRange(0, count), options: opts, usingComparator: cmptr)
533533
}
534534

535-
open func sortRange(_ range: NSRange, options opts: SortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) {
535+
open func sortRange(_ range: NSRange, options opts: NSSortOptions = [], usingComparator cmptr: (Any, Any) -> ComparisonResult) {
536536
// The sort options are not available. We use the Array's sorting algorithm. It is not stable neither concurrent.
537537
guard opts.isEmpty else {
538538
NSUnimplemented()

0 commit comments

Comments
 (0)