Skip to content

Commit 142c8c8

Browse files
lorenteyikesyo
andauthored
Apply suggestions from code review
Co-Authored-By: ikesyo <[email protected]>
1 parent 3ecb7d2 commit 142c8c8

10 files changed

+14
-14
lines changed

Foundation/Calendar.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,9 @@ public struct Calendar : Hashable, Equatable, ReferenceConvertible, _MutableBoxi
862862
public func hash(into hasher: inout Hasher) {
863863
// We implement hash ourselves, because we need to make sure autoupdating calendars have the same hash
864864
if _autoupdating {
865-
hasher.combine(1)
865+
hasher.combine(1 as Int8)
866866
} else {
867-
hasher.combine(_handle.map { $0.hash })
867+
hasher.combine(_handle.map { $0 })
868868
}
869869
}
870870

Foundation/CharacterSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
170170
}
171171

172172
public func hash(into hasher: inout Hasher) {
173-
hasher.combine(_mapUnmanaged { $0.hashValue })
173+
hasher.combine(_mapUnmanaged { $0 })
174174
}
175175

176176
public var description: String {

Foundation/DateComponents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _Mutab
303303
// MARK: -
304304

305305
public func hash(into hasher: inout Hasher) {
306-
hasher.combine(_handle.map { $0.hash })
306+
hasher.combine(_handle.map { $0 })
307307
}
308308

309309
public static func ==(lhs: DateComponents, rhs: DateComponents) -> Bool {

Foundation/IndexSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
174174
}
175175

176176
public func hash(into hasher: inout Hasher) {
177-
hasher.combine(_handle.map { $0.hash })
177+
hasher.combine(_handle.map { $0 })
178178
}
179179

180180
/// Returns the number of integers in `self`.

Foundation/Locale.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ public struct Locale : CustomStringConvertible, CustomDebugStringConvertible, Ha
423423

424424
public func hash(into hasher: inout Hasher) {
425425
if _autoupdating {
426-
hasher.combine(1)
426+
hasher.combine(1 as Int8)
427427
} else {
428-
hasher.combine(_wrapped.hash)
428+
hasher.combine(_wrapped)
429429
}
430430
}
431431

Foundation/PersonNameComponents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public struct PersonNameComponents : ReferenceConvertible, Hashable, Equatable,
6969
}
7070

7171
public func hash(into hasher: inout Hasher) {
72-
hasher.combine(_handle.map { $0.hash })
72+
hasher.combine(_handle.map { $0 })
7373
}
7474

7575
public static func ==(lhs : PersonNameComponents, rhs: PersonNameComponents) -> Bool {

Foundation/TimeZone.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ public struct TimeZone : Hashable, Equatable, ReferenceConvertible {
212212

213213
public func hash(into hasher: inout Hasher) {
214214
if _autoupdating {
215-
hasher.combine(1)
215+
hasher.combine(1 as Int8)
216216
} else {
217-
hasher.combine(_wrapped.hash)
217+
hasher.combine(_wrapped)
218218
}
219219
}
220220

Foundation/URL.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public struct URL : ReferenceConvertible, Equatable {
504504
}
505505

506506
public func hash(into hasher: inout Hasher) {
507-
hasher.combine(_url.hash)
507+
hasher.combine(_url)
508508
}
509509

510510
// MARK: -

Foundation/URLComponents.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, Equatable, _Mutabl
275275
}
276276

277277
public func hash(into hasher: inout Hasher) {
278-
hasher.combine(_handle.map { $0.hash })
278+
hasher.combine(_handle.map { $0 })
279279
}
280280

281281
// MARK: - Bridging
@@ -348,7 +348,7 @@ public struct URLQueryItem : ReferenceConvertible, Hashable, Equatable {
348348
}
349349

350350
public func hash(into hasher: inout Hasher) {
351-
hasher.combine(_queryItem.hash)
351+
hasher.combine(_queryItem)
352352
}
353353

354354
public static func ==(lhs: URLQueryItem, rhs: URLQueryItem) -> Bool {

Foundation/URLRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public struct URLRequest : ReferenceConvertible, Equatable, Hashable {
228228
}
229229

230230
public func hash(into hasher: inout Hasher) {
231-
hasher.combine(_handle.map { $0.hashValue })
231+
hasher.combine(_handle.map { $0 })
232232
}
233233

234234
public static func ==(lhs: URLRequest, rhs: URLRequest) -> Bool {

0 commit comments

Comments
 (0)