Skip to content

Commit

Permalink
fix(sui-move-natives): replace deprecated method
Browse files Browse the repository at this point in the history
`indexmap::IndexSet::remove` is replaced by `indexmap::IndexSet::swap_remove`
  • Loading branch information
kodemartin committed Apr 18, 2024
1 parent b018ef4 commit c51a7ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl<'a> ObjectRuntime<'a> {
// remove from deleted_ids for the case in dynamic fields where the Field object was deleted
// and then re-added in a single transaction. In that case, we also skip adding it
// to new_ids.
let was_present = self.state.deleted_ids.remove(&id);
let was_present = self.state.deleted_ids.swap_remove(&id);
if !was_present {
// mark the id as new
self.state.new_ids.insert(id);
Expand Down Expand Up @@ -227,7 +227,7 @@ impl<'a> ObjectRuntime<'a> {
));
};

let was_new = self.state.new_ids.remove(&id);
let was_new = self.state.new_ids.swap_remove(&id);
if !was_new {
self.state.deleted_ids.insert(id);
}
Expand Down
6 changes: 3 additions & 3 deletions sui-execution/latest/sui-move-natives/src/test_scenario.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ pub fn end_transaction(
{
for addr_inventory in inventories.address_inventories.values_mut() {
for s in addr_inventory.values_mut() {
s.remove(id);
s.swap_remove(id);
}
}
for s in &mut inventories.shared_inventory.values_mut() {
s.remove(id);
s.swap_remove(id);
}
for s in &mut inventories.immutable_inventory.values_mut() {
s.remove(id);
s.swap_remove(id);
}
inventories.taken.remove(id);
}
Expand Down

0 comments on commit c51a7ee

Please sign in to comment.