Skip to content

Commit bd1dfce

Browse files
committed
Don't allocate it IndexVec::remove
1 parent e1cd99f commit bd1dfce

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_index/src

1 file changed

+1
-1
lines changed

compiler/rustc_index/src/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ impl<I: Idx, T> IndexVec<I, Option<T>> {
460460

461461
#[inline]
462462
pub fn remove(&mut self, index: I) -> Option<T> {
463-
self.ensure_contains_elem(index, || None).take()
463+
self.get_mut(index)?.take()
464464
}
465465
}
466466

0 commit comments

Comments
 (0)