Skip to content

Commit 9eeb9ff

Browse files
committed
---
yaml --- r: 284671 b: refs/heads/swift-5.1-branch-04-24-2019 c: ca44560 h: refs/heads/master i: 284669: e6e36d5 284667: c73fe4d 284663: e8b130c 284655: 0ae9abf 284639: 64347de 284607: 654dd1f 284543: ff7d609 284415: 764befe 284159: 5d96af4 283647: 629dc2e 282623: 76f0260
1 parent 0b86f0a commit 9eeb9ff

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,4 +1319,4 @@ refs/heads/revert-24065-raj-es-perf-bench: acd6c09b6bd8c5aa922845ee4465bf1333e4f
13191319
refs/heads/rxwei-patch-3: d5f349dedfb5fcaf84c5ac788ad33ea47e502d11
13201320
refs/heads/rxwei-patch-4: d60ed33a03d398b956e1aa81f37b04d0b1cf101e
13211321
refs/heads/rxwei-patch-4-1: b7adfa58fd761906363d280fe323578f61097822
1322-
refs/heads/swift-5.1-branch-04-24-2019: 7505c6a63ec40022db655ebebf84d5316c3ff71b
1322+
refs/heads/swift-5.1-branch-04-24-2019: ca44560070b46f72c030c40188baee4687deaa75

branches/swift-5.1-branch-04-24-2019/stdlib/public/Darwin/Foundation/IndexPath.swift

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -662,32 +662,9 @@ public struct IndexPath : ReferenceConvertible, Equatable, Hashable, MutableColl
662662
return .orderedSame
663663
}
664664

665-
public var hashValue: Int { // FIXME(hashValue): Remove
666-
func hashIndexes(first: Int, last: Int, count: Int) -> Int {
667-
let totalBits = MemoryLayout<Int>.size * 8
668-
let lengthBits = 8
669-
let firstIndexBits = (totalBits - lengthBits) / 2
670-
return count &+ (first << lengthBits) &+ (last << (lengthBits + firstIndexBits))
671-
}
672-
673-
switch _indexes {
674-
case .empty: return 0
675-
case .single(let index): return index.hashValue
676-
case .pair(let first, let second):
677-
return hashIndexes(first: first, last: second, count: 2)
678-
default:
679-
let cnt = _indexes.count
680-
return hashIndexes(first: _indexes[0], last: _indexes[cnt - 1], count: cnt)
681-
}
682-
}
683-
684665
public func hash(into hasher: inout Hasher) {
685666
// Note: We compare all indices in ==, so for proper hashing, we must
686-
// also feed them all to the hasher. (This is intentionally different
687-
// from `hashValue` above, which only depends on the first and last
688-
// index. `Set` and `Dictionary` relies on `hash(into:)` rather than
689-
// `hashValue` -- the latter definition is only kept for compatibility
690-
// with existing code that may depend on it.)
667+
// also feed them all to the hasher.
691668
//
692669
// To ensure we have unique hash encodings in nested hashing contexts,
693670
// we combine the count of indices as well as the indices themselves.

0 commit comments

Comments
 (0)