Skip to content

Commit 562b6ec

Browse files
committed
[Foundation] TimeZone: Modernize hashing
1 parent ae5c8e7 commit 562b6ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Darwin/Foundation-swiftoverlay/TimeZone.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,12 @@ public struct TimeZone : Hashable, Equatable, ReferenceConvertible {
196196

197197
// MARK: -
198198

199-
public var hashValue : Int {
199+
public func hash(into hasher: inout Hasher) {
200200
if _autoupdating {
201-
return 1
201+
hasher.combine(false)
202202
} else {
203-
return _wrapped.hash
203+
hasher.combine(true)
204+
hasher.combine(_wrapped)
204205
}
205206
}
206207

0 commit comments

Comments
 (0)