Skip to content

Commit

Permalink
Merge pull request #69 from Entropy-Foundation/fix-two-key-registry
Browse files Browse the repository at this point in the history
Fix two key registry
  • Loading branch information
so-schen authored Sep 16, 2024
2 parents 496835b + 86ac4c1 commit 5aa17f8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions types/src/state_store/state_key/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,7 @@ where
fn maybe_remove(&self, key1: &Key1, key2: &Key2) {
let mut locked = self.inner.write();
if let Some(map2) = locked.get_mut(key1) {
if let Some(entry) = map2.get(key2) {
if entry.upgrade().is_none() {
map2.remove(key2);
}
}
map2.remove(key2);
if map2.is_empty() {
locked.remove(key1);
}
Expand Down

0 comments on commit 5aa17f8

Please sign in to comment.