From a7c83bc3741fd463ea5725bf22c59f554e167e18 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 2 Jul 2020 12:11:55 -0700 Subject: [PATCH] Use plain clear instead of clear_no_drop It was an over-optimization to use `clear_no_drop`, which hurts the possibility of using griddle as an alternate table implementation. --- src/map/core.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/core.rs b/src/map/core.rs index e5b82679..22edc1e1 100644 --- a/src/map/core.rs +++ b/src/map/core.rs @@ -128,12 +128,12 @@ impl IndexMapCore { } pub(crate) fn clear(&mut self) { - self.indices.clear_no_drop(); + self.indices.clear(); self.entries.clear(); } pub(crate) fn drain(&mut self, range: RangeFull) -> Drain> { - self.indices.clear_no_drop(); + self.indices.clear(); self.entries.drain(range) } @@ -217,7 +217,7 @@ impl IndexMapCore { } fn rebuild_hash_table(&mut self) { - self.indices.clear_no_drop(); + self.indices.clear(); debug_assert!(self.indices.capacity() >= self.entries.len()); for (i, entry) in enumerate(&self.entries) { // We should never have to reallocate, so there's no need for a real hasher.