mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Foundation] NSRange: Modernize hashing
This commit is contained in:
@@ -13,14 +13,6 @@
|
||||
@_exported import Foundation // Clang module
|
||||
|
||||
extension NSRange : Hashable {
|
||||
public var hashValue: Int { // FIXME(hashValue): Remove
|
||||
#if arch(i386) || arch(arm)
|
||||
return Int(bitPattern: (UInt(bitPattern: location) | (UInt(bitPattern: length) << 16)))
|
||||
#elseif arch(x86_64) || arch(arm64)
|
||||
return Int(bitPattern: (UInt(bitPattern: location) | (UInt(bitPattern: length) << 32)))
|
||||
#endif
|
||||
}
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(location)
|
||||
hasher.combine(length)
|
||||
|
||||
Reference in New Issue
Block a user