diff --git a/Package.swift b/Package.swift index 92d6bb5..7db5ad3 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:4.0 +// swift-tools-version:4.2 import PackageDescription let package = Package( diff --git a/Sources/CountedSet/CountedSet.swift b/Sources/CountedSet/CountedSet.swift index 9e932c8..3590f7d 100644 --- a/Sources/CountedSet/CountedSet.swift +++ b/Sources/CountedSet/CountedSet.swift @@ -237,16 +237,8 @@ extension CountedSet: CustomStringConvertible, CustomDebugStringConvertible { } extension CountedSet : Hashable { - public var hashValue: Int { - var hash = 5381 - - for (element, count) in backingDictionary { - for _ in 1...count { - hash = ((hash << 5) &+ hash) &+ element.hashValue - } - } - - return hash + public func hash(into hasher: inout Hasher) { + hasher.combine(backingDictionary) } }