Skip to content

Commit 823e5d4

Browse files
authored
Merge pull request swiftlang#41132 from lorentey/ObjectIdentifier-single-shot-hashing
[stdlib] Speed up `ObjectIdentifier`-keyed dictionaries
2 parents e6a1e23 + a72544f commit 823e5d4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/core/ObjectIdentifier.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ extension ObjectIdentifier: Hashable {
9595
public func hash(into hasher: inout Hasher) {
9696
hasher.combine(Int(Builtin.ptrtoint_Word(_value)))
9797
}
98+
99+
@_alwaysEmitIntoClient // For back deployment
100+
public func _rawHashValue(seed: Int) -> Int {
101+
Int(Builtin.ptrtoint_Word(_value))._rawHashValue(seed: seed)
102+
}
98103
}
99104

100105
extension UInt {

0 commit comments

Comments
 (0)