diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_arena/src/map.rs | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/crates/ra_arena/src/map.rs b/crates/ra_arena/src/map.rs index b9521c342..e4ddbad42 100644 --- a/crates/ra_arena/src/map.rs +++ b/crates/ra_arena/src/map.rs | |||
@@ -14,9 +14,6 @@ pub struct ArenaMap<ID, V> { | |||
14 | impl<T, V> ArenaMap<Idx<T>, V> { | 14 | impl<T, V> ArenaMap<Idx<T>, V> { |
15 | pub fn insert(&mut self, id: Idx<T>, t: V) { | 15 | pub fn insert(&mut self, id: Idx<T>, t: V) { |
16 | let idx = Self::to_idx(id); | 16 | let idx = Self::to_idx(id); |
17 | if self.v.capacity() <= idx { | ||
18 | self.v.reserve(idx + 1 - self.v.capacity()); | ||
19 | } | ||
20 | 17 | ||
21 | let fill = (idx + 1).saturating_sub(self.v.len()); | 18 | let fill = (idx + 1).saturating_sub(self.v.len()); |
22 | self.v.extend(std::iter::repeat_with(|| None).take(fill)); | 19 | self.v.extend(std::iter::repeat_with(|| None).take(fill)); |