forked from Deuxfleurs/garage
fix misuse of sled transactions
This commit is contained in:
parent
20e6e9fa20
commit
a52ab69640
1 changed files with 1 additions and 1 deletions
|
@ -431,7 +431,7 @@ where
|
||||||
|
|
||||||
pub(crate) fn delete_if_equal(self: &Arc<Self>, k: &[u8], v: &[u8]) -> Result<bool, Error> {
|
pub(crate) fn delete_if_equal(self: &Arc<Self>, k: &[u8], v: &[u8]) -> Result<bool, Error> {
|
||||||
let removed = self.store.transaction(|txn| {
|
let removed = self.store.transaction(|txn| {
|
||||||
if let Some(cur_v) = self.store.get(k)? {
|
if let Some(cur_v) = txn.get(k)? {
|
||||||
if cur_v == v {
|
if cur_v == v {
|
||||||
txn.remove(v)?;
|
txn.remove(v)?;
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
|
|
Loading…
Reference in a new issue