Use hash(into:) instead of hashValue

This commit is contained in:
Milen Dzhumerov 2019-07-27 12:55:56 +01:00
parent 18ac7739ae
commit 861f0cc605
2 changed files with 7 additions and 4 deletions

View File

@ -105,8 +105,10 @@ extension HeaderMap {
}
extension HeaderMap.Entry: Hashable {
public var hashValue: Int {
return key.hashValue ^ prefix.hashValue ^ suffix.hashValue
public func hash(into hasher: inout Hasher) {
hasher.combine(key)
hasher.combine(prefix)
hasher.combine(suffix)
}
public static func ==(lhs: HeaderMap.Entry, rhs: HeaderMap.Entry) -> Bool {

View File

@ -146,8 +146,9 @@ public extension HeaderMap.Entry {
}
extension JSONHeaderMap.Entry: Hashable {
public var hashValue: Int {
return prefix.hashValue ^ suffix.hashValue
public func hash(into hasher: inout Hasher) {
hasher.combine(prefix)
hasher.combine(suffix)
}
public static func ==(lhs: JSONHeaderMap.Entry, rhs: JSONHeaderMap.Entry) -> Bool {