mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix contact ids scan
This commit is contained in:
parent
bcdf3db63b
commit
b90e1bcef6
@ -21,14 +21,6 @@ final class ContactTable: Table {
|
||||
return sharedKey
|
||||
}
|
||||
|
||||
private func lowerBound() -> ValueBoxKey {
|
||||
return self.key(PeerId(0))
|
||||
}
|
||||
|
||||
private func upperBound() -> ValueBoxKey {
|
||||
return self.key(PeerId.max)
|
||||
}
|
||||
|
||||
func isContact(peerId: PeerId) -> Bool {
|
||||
return self.get().contains(peerId)
|
||||
}
|
||||
@ -38,10 +30,10 @@ final class ContactTable: Table {
|
||||
return peerIds
|
||||
} else {
|
||||
var peerIds = Set<PeerId>()
|
||||
self.valueBox.range(self.table, start: self.lowerBound(), end: self.upperBound(), keys: { key in
|
||||
self.valueBox.scan(self.table, keys: { key in
|
||||
peerIds.insert(PeerId(key.getInt64(0)))
|
||||
return true
|
||||
}, limit: 0)
|
||||
})
|
||||
self.peerIds = peerIds
|
||||
return peerIds
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user