Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 839d7f2

Browse files
authored
Merge pull request #182 from alexcrichton/remove-helper-method
Remove no-longer-needed helper method
2 parents b24cf9a + 08492ed commit 839d7f2

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

cranelift/entity/src/primary.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ where
7272
self.elems.get_mut(k.index())
7373
}
7474

75-
/// Get the element at `k` if it exists, mutable version.
76-
pub fn get_mut_or_insert_with(&mut self, k: K, f: impl FnOnce() -> V) -> &mut V {
77-
if self.elems.get(k.index()).is_none() {
78-
self.elems.insert(k.index(), f());
79-
}
80-
81-
self.elems
82-
.get_mut(k.index())
83-
.expect("missing existing element")
84-
}
85-
8675
/// Is this map completely empty?
8776
pub fn is_empty(&self) -> bool {
8877
self.elems.is_empty()

crates/wasmtime/src/runtime/component/concurrent/futures_and_streams.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3143,9 +3143,7 @@ impl ComponentInstance {
31433143
// Here we reflect the newly created global concurrent error context state into the
31443144
// component instance's locally tracked count, along with the appropriate key into the global
31453145
// ref tracking data structures to enable later lookup
3146-
let local_tbl = self
3147-
.error_context_tables()
3148-
.get_mut_or_insert_with(ty, || StateTable::default());
3146+
let local_tbl = &mut self.error_context_tables()[ty];
31493147

31503148
assert!(
31513149
!local_tbl.has_handle(table_id.rep()),

0 commit comments

Comments
 (0)