Skip to content

Commit

Permalink
Fix set
Browse files Browse the repository at this point in the history
  • Loading branch information
changgyoopark-db committed Aug 15, 2024
1 parent c963e28 commit 181b1e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/stores/scc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ impl KVMap for SccHashMap {

impl KVMapHandle for SccHashMap {
fn set(&mut self, key: &[u8], value: &[u8]) {
let _result = self.0.insert(key.into(), value.into());
match self.0.entry(key.into()) {
scc::hash_map::Entry::Occupied(mut o) => {
*o.get_mut() = value.into();
}
scc::hash_map::Entry::Vacant(v) => {
v.insert_entry(value.into());
}
}
}

fn get(&mut self, key: &[u8]) -> Option<Box<[u8]>> {
Expand Down

0 comments on commit 181b1e4

Please sign in to comment.