We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fd0be8 commit 0ab8bb3Copy full SHA for 0ab8bb3
stdlib/public/SDK/Foundation/NSRange.swift
@@ -13,8 +13,12 @@
13
@_exported import Foundation // Clang module
14
15
extension NSRange : Hashable {
16
- public var hashValue: Int {
17
- return Int(bitPattern: UInt(location) ^ UInt(location))
+ public var hashValue: Int {
+#if arch(i386) || arch(arm)
18
+ return Int(bitPattern: (UInt(bitPattern: location) | (UInt(bitPattern: length) << 16)))
19
+#elseif arch(x86_64) || arch(arm64)
20
+ return Int(bitPattern: (UInt(bitPattern: location) | (UInt(bitPattern: length) << 32)))
21
+#endif
22
}
23
24
public static func==(_ lhs: NSRange, _ rhs: NSRange) -> Bool {
0 commit comments