mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Add additional check [skip ci]
This commit is contained in:
parent
f2cc0bb423
commit
bbd3a3af92
@ -794,6 +794,7 @@ private final class ChatListViewSpaceState {
|
||||
}
|
||||
|
||||
self.checkEntries(postbox: postbox)
|
||||
self.checkReplayEntries(postbox: postbox)
|
||||
|
||||
return hasUpdates
|
||||
}
|
||||
@ -822,6 +823,14 @@ private final class ChatListViewSpaceState {
|
||||
#endif
|
||||
}
|
||||
|
||||
private func checkReplayEntries(postbox: Postbox) {
|
||||
#if DEBUG
|
||||
let cleanState = ChatListViewSpaceState(postbox: postbox, space: self.space, anchorIndex: self.anchorIndex, summaryComponents: self.summaryComponents, halfLimit: self.halfLimit)
|
||||
assert(self.orderedEntries.lowerOrAtAnchor.map { $0.index } == cleanState.orderedEntries.lowerOrAtAnchor.map { $0.index })
|
||||
assert(self.orderedEntries.higherThanAnchor.map { $0.index } == cleanState.orderedEntries.higherThanAnchor.map { $0.index })
|
||||
#endif
|
||||
}
|
||||
|
||||
private func add(entry: MutableChatListEntry) -> Bool {
|
||||
if self.anchorIndex >= entry.entryIndex {
|
||||
let insertionIndex = binaryInsertionIndex(self.orderedEntries.lowerOrAtAnchor, extract: { $0.entryIndex }, searchItem: entry.entryIndex)
|
||||
|
Loading…
x
Reference in New Issue
Block a user