Add, as a micro-optimization, a custom hash function for FeedIdentifier.
This commit is contained in:
parent
b50fabe325
commit
30cf8c6a08
|
@ -80,4 +80,18 @@ public enum FeedIdentifier: CustomStringConvertible, Hashable {
|
|||
}
|
||||
}
|
||||
|
||||
// MARK: - Hashable
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
switch self {
|
||||
case .smartFeed(let id):
|
||||
hasher.combine(id)
|
||||
case .script(let id):
|
||||
hasher.combine(id)
|
||||
case .webFeed(_, let webFeedID):
|
||||
hasher.combine(webFeedID)
|
||||
case .folder(_, let folderName):
|
||||
hasher.combine(folderName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue