Skip to content

Commit 545fa5e

Browse files
committed
[stdlib] Re-add previously synthesized hashing definitions
1 parent 8bd5650 commit 545fa5e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

stdlib/public/core/FloatingPoint.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,19 @@ public enum FloatingPointSign: Int {
12371237
public static func ==(a: FloatingPointSign, b: FloatingPointSign) -> Bool {
12381238
return a.rawValue == b.rawValue
12391239
}
1240+
1241+
@inlinable
1242+
public var hashValue: Int { return rawValue.hashValue }
1243+
1244+
@inlinable
1245+
public func hash(into hasher: inout Hasher) {
1246+
hasher.combine(rawValue)
1247+
}
1248+
1249+
@inlinable
1250+
public func _rawHashValue(seed: Int) -> Int {
1251+
return rawValue._rawHashValue(seed: seed)
1252+
}
12401253
}
12411254

12421255
/// The IEEE 754 floating-point classes.

stdlib/public/core/UnicodeScalarProperties.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,12 +1258,27 @@ extension Unicode {
12581258
self.rawValue = rawValue
12591259
}
12601260

1261+
public static func == (
1262+
lhs: CanonicalCombiningClass,
1263+
rhs: CanonicalCombiningClass
1264+
) -> Bool {
1265+
return lhs.rawValue == rhs.rawValue
1266+
}
1267+
12611268
public static func < (
12621269
lhs: CanonicalCombiningClass,
12631270
rhs: CanonicalCombiningClass
12641271
) -> Bool {
12651272
return lhs.rawValue < rhs.rawValue
12661273
}
1274+
1275+
public var hashValue: Int {
1276+
return rawValue.hashValue
1277+
}
1278+
1279+
public func hash(into hasher: inout Hasher) {
1280+
hasher.combine(rawValue)
1281+
}
12671282
}
12681283
}
12691284

0 commit comments

Comments
 (0)