From ebef6bc24db04dac8b463c820b372d1895ea7584 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Mon, 20 Nov 2023 10:14:57 +0100 Subject: [PATCH] Simplify documents database writing --- milli/src/update/index_documents/typed_chunk.rs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/milli/src/update/index_documents/typed_chunk.rs b/milli/src/update/index_documents/typed_chunk.rs index dda2ebc1c..4f9f0ef6f 100644 --- a/milli/src/update/index_documents/typed_chunk.rs +++ b/milli/src/update/index_documents/typed_chunk.rs @@ -140,20 +140,9 @@ pub(crate) fn write_typed_chunk_into_index( for (field_id, value) in reader.iter() { let del_add_reader = KvReaderDelAdd::new(value); - match ( - del_add_reader.get(DelAdd::Deletion), - del_add_reader.get(DelAdd::Addition), - ) { - (None, None) => {} - (None, Some(value)) => { - // anyway, write - writer.insert(field_id, value)?; - } - (Some(_), None) => {} - (Some(_), Some(value)) => { - // updated field, write - writer.insert(field_id, value)?; - } + + if let Some(addition) = del_add_reader.get(DelAdd::Addition) { + writer.insert(field_id, addition)?; } }