optimize increment

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk committed 2024-06-30 18:01:20 +00:00
1 parent 3480074f61
commit c1712d4d8b
3 files changed
+48 -12

No files matched your search

+2 -2
View File
@@ -155,13 +155,13 @@ impl KvTree for RocksDbEngineTree<'_> {
let new = utils::increment(old.as_deref());
self.db
.rocks
.put_cf_opt(&self.cf(), key, &new, &writeoptions)?;
.put_cf_opt(&self.cf(), key, new, &writeoptions)?;
if !self.db.corked() {
self.db.flush()?;
}
Ok(new)
Ok(new.to_vec())
}
fn increment_batch(&self, iter: &mut dyn Iterator<Item = Vec<u8>>) -> Result<()> {