mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 00:34:26 +01:00
feat: Prefer binary to exponential search
This commit is contained in:
parent
a8df438814
commit
6393b0cbc0
@ -131,7 +131,7 @@ fn merge_ranked_maps(existing: Option<&[u8]>, operands: &mut MergeOperands) -> V
|
|||||||
let mut ranked_map = RankedMap::default();
|
let mut ranked_map = RankedMap::default();
|
||||||
for bytes in existing.into_iter().chain(operands) {
|
for bytes in existing.into_iter().chain(operands) {
|
||||||
match ReadRankedMapEvent::from_bytes(bytes.to_vec()).unwrap() {
|
match ReadRankedMapEvent::from_bytes(bytes.to_vec()).unwrap() {
|
||||||
RemovedDocuments(d) => ranked_map.retain(|(k, _), _| !d.as_ref().contains(k)),
|
RemovedDocuments(d) => ranked_map.retain(|(k, _), _| !d.as_ref().binary_search(k).is_ok()),
|
||||||
UpdatedDocuments(i) => ranked_map.extend(i),
|
UpdatedDocuments(i) => ranked_map.extend(i),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user