preload history small optimization

This commit is contained in:
Mike Renoir
2022-11-05 21:33:27 +04:00
parent 7d335e817a
commit 3eec2e834e
2 changed files with 10 additions and 3 deletions

View File

@@ -247,12 +247,19 @@ private final class AdditionalPreloadPeerIdsContext {
}
}
public struct ChatHistoryPreloadItem : Equatable {
public struct ChatHistoryPreloadItem : Equatable, Hashable {
public let index: ChatListIndex
public let threadId: Int64?
public let isMuted: Bool
public let hasUnread: Bool
public func hash(into hasher: inout Hasher) {
hasher.combine(index.hashValue)
if let threadId = threadId {
hasher.combine(threadId)
}
}
public init(index: ChatListIndex, threadId: Int64?, isMuted: Bool, hasUnread: Bool) {
self.index = index
self.threadId = threadId