optimize increment
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
3480074f61
commit
c1712d4d8b
3 changed files with 48 additions and 12 deletions
|
@ -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<()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue