Simplify documents database writing

This commit is contained in:
ManyTheFish 2023-11-20 10:14:57 +01:00
parent d59b7db8d0
commit ebef6bc24d

View File

@ -140,20 +140,9 @@ pub(crate) fn write_typed_chunk_into_index(
for (field_id, value) in reader.iter() { for (field_id, value) in reader.iter() {
let del_add_reader = KvReaderDelAdd::new(value); let del_add_reader = KvReaderDelAdd::new(value);
match (
del_add_reader.get(DelAdd::Deletion), if let Some(addition) = del_add_reader.get(DelAdd::Addition) {
del_add_reader.get(DelAdd::Addition), writer.insert(field_id, 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)?;
}
} }
} }