Swift 5.1 support
Use stdlib Result instead of TAsyncResult
Fix: deprecations for `withUnsafeBytes`
Bump CI job Xcode version
Hash (into)
Co-authored-by: Sophie Lambrakis <SLambrakis@users.noreply.github.com>
Co-authored-by: Alexander Edge <alex@alexedge.co.uk>
diff --git a/lib/swift/Sources/TMap.swift b/lib/swift/Sources/TMap.swift
index dcf1481..8f52067 100644
--- a/lib/swift/Sources/TMap.swift
+++ b/lib/swift/Sources/TMap.swift
@@ -17,7 +17,7 @@
* under the License.
*/
-public struct TMap<Key : TSerializable & Hashable, Value : TSerializable>: Collection, ExpressibleByDictionaryLiteral, Hashable, TSerializable {
+public struct TMap<Key : TSerializable & Hashable, Value : TSerializable & Hashable>: Collection, ExpressibleByDictionaryLiteral, Hashable, TSerializable {
public typealias Storage = Dictionary<Key, Value>
public typealias Element = Storage.Element
public typealias Index = Storage.Index
@@ -111,15 +111,9 @@
}
/// Mark: Hashable
-
- public var hashValue: Int {
- let prime = 31
- var result = 1
- for (key, value) in storage {
- result = prime &* result &+ key.hashValue
- result = prime &* result &+ value.hashValue
- }
- return result
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(storage)
}
/// Mark: TSerializable