Add, as a micro-optimization, a custom hash function for FeedIdentifier.
This commit is contained in:
parent
b50fabe325
commit
30cf8c6a08
|
@ -79,5 +79,19 @@ public enum FeedIdentifier: CustomStringConvertible, Hashable {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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