diff options
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/data.rs | 2 | ||||
-rw-r--r-- | src/table/gc.rs | 7 | ||||
-rw-r--r-- | src/table/merkle.rs | 11 |
3 files changed, 12 insertions, 8 deletions
diff --git a/src/table/data.rs b/src/table/data.rs index ebfae551..dc1fd445 100644 --- a/src/table/data.rs +++ b/src/table/data.rs @@ -276,7 +276,7 @@ where if blake2sum(&cur_v[..]) == vhash { tx.remove(&self.store, k)?; tx.insert(&self.merkle_todo, k, vec![])?; - return Ok(Some(cur_v.into_owned())); + return Ok(Some(cur_v.into_vec())); } } Ok(None) diff --git a/src/table/gc.rs b/src/table/gc.rs index 04872a38..260fecfa 100644 --- a/src/table/gc.rs +++ b/src/table/gc.rs @@ -378,8 +378,11 @@ impl GcTodoEntry { let key = self.todo_table_key(); gc_todo_tree.db().transaction(|tx| { let old_val = tx.get(gc_todo_tree, &key)?; - if old_val == Some(self.value_hash.as_slice().into()) { - tx.remove(gc_todo_tree, &key)?; + match old_val { + Some(ov) if ov == self.value_hash.as_slice() => { + tx.remove(gc_todo_tree, &key)?; + } + _ => (), } tx.commit(()) })?; diff --git a/src/table/merkle.rs b/src/table/merkle.rs index 6e0c2f7e..f7dca97b 100644 --- a/src/table/merkle.rs +++ b/src/table/merkle.rs @@ -142,11 +142,12 @@ where let deleted = self.data.merkle_todo.db().transaction(|tx| { let old_val = tx.get(&self.data.merkle_todo, k)?; - if old_val == Some(vhash_by.into()) { - tx.remove(&self.data.merkle_todo, k)?; - tx.commit(true) - } else { - tx.commit(false) + match old_val { + Some(ov) if ov == vhash_by => { + tx.remove(&self.data.merkle_todo, k)?; + tx.commit(true) + } + _ => tx.commit(false), } })?; |