diff --git a/submodules/Postbox/Sources/ContactTable.swift b/submodules/Postbox/Sources/ContactTable.swift index 84ead561b2..e774bd3e60 100644 --- a/submodules/Postbox/Sources/ContactTable.swift +++ b/submodules/Postbox/Sources/ContactTable.swift @@ -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() - 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 }