mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 21:20:24 +01:00
Update milli/src/update/index_documents/transform.rs
Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
parent
43a19d0709
commit
8de3c9f737
@ -786,9 +786,8 @@ fn merge_obkvs_and_operations<'a>(_key: &[u8], obkvs: &[Cow<'a, [u8]>]) -> Resul
|
|||||||
// we can ignore everything that happened before the last delete.
|
// we can ignore everything that happened before the last delete.
|
||||||
let starting_position = obkvs
|
let starting_position = obkvs
|
||||||
.iter()
|
.iter()
|
||||||
.rev()
|
.rposition(|obkv| obkv[0] == Operation::Deletion as u8)
|
||||||
.position(|obkv| obkv[0] == Operation::Deletion as u8)
|
.unwrap_or(0);
|
||||||
.map_or(0, |pos| obkvs.len() - pos);
|
|
||||||
|
|
||||||
// [add, add, delete]
|
// [add, add, delete]
|
||||||
// if the last operation was a deletion then we simply return the deletion
|
// if the last operation was a deletion then we simply return the deletion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user