[Foundation] NSRange: Modernize hashing

This commit is contained in:
Karoy Lorentey
2019-04-05 11:40:11 -07:00
parent 4bdc458c52
commit afa253961b

View File

@@ -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)