Use synthesized implementation

This commit is contained in:
Zhiyu Zhu/朱智语 2019-04-05 15:01:00 -04:00
parent a3fdd633a6
commit f1a1812ff2
3 changed files with 2 additions and 16 deletions

View File

@ -8,11 +8,6 @@ struct BagKey: Equatable {
fileprivate init(underlying: UInt64) {
self.i = underlying
}
/// Returns a Boolean value indicating whether two BagKeys are equal.
static func == (lhs: BagKey, rhs: BagKey) -> Bool {
return lhs.i == rhs.i
}
}
/// A generator that can generate a sequence of unique `BagKey`.

View File

@ -12,13 +12,7 @@ public struct Interval {
}
}
extension Interval: Hashable {
/// Returns a boolean value indicating whether two intervals are equal.
public static func == (lhs: Interval, rhs: Interval) -> Bool {
return lhs.nanoseconds == rhs.nanoseconds
}
}
extension Interval: Hashable { }
extension Interval {

View File

@ -8,15 +8,12 @@ extension TaskCenter {
weak var task: Task?
let hash: Int
init(_ task: Task) {
self.task = task
self.hash = task.hashValue
}
func hash(into hasher: inout Hasher) {
hasher.combine(hash)
hasher.combine(task)
}
static func == (lhs: TaskBox, rhs: TaskBox) -> Bool {