optimize increment

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-06-25 01:31:52 +00:00
parent 3480074f61
commit c1712d4d8b
3 changed files with 48 additions and 12 deletions

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<()> {