mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 16:26:04 +00:00
Improve performance of finding updated articles by improving performance of comparing articles by improving performance of comparing authors.
This commit is contained in:
1 parent
b61cd3a869
commit
ffaa630f34
1 file changed
+14
@@ -53,6 +53,20 @@ public struct Author: Codable, Hashable {
|
||||
}
|
||||
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 {
|
||||
|
||||
Reference in new issue
Block a user