mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 12:06:58 +01:00
Improve performance of finding updated articles by improving performance of comparing articles by improving performance of comparing authors.
This commit is contained in:
parent
b61cd3a869
commit
ffaa630f34
@ -53,6 +53,20 @@ public struct Author: Codable, Hashable {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Hashable
|
||||||
|
|
||||||
|
public func hash(into hasher: inout Hasher) {
|
||||||
|
hasher.combine(authorID)
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - Equatable
|
||||||
|
|
||||||
|
static public func ==(lhs: Author, rhs: Author) -> Bool {
|
||||||
|
// The authorID is a calculation based on all the properties,
|
||||||
|
// and so it’s a quick shortcut to determine equality.
|
||||||
|
return lhs.authorID == rhs.authorID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Set where Element == Author {
|
extension Set where Element == Author {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user