Skip to content

Commit a7c83bc

Browse files
committed
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.
1 parent e5f0a23 commit a7c83bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/map/core.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ impl<K, V> IndexMapCore<K, V> {
128128
}
129129

130130
pub(crate) fn clear(&mut self) {
131-
self.indices.clear_no_drop();
131+
self.indices.clear();
132132
self.entries.clear();
133133
}
134134

135135
pub(crate) fn drain(&mut self, range: RangeFull) -> Drain<Bucket<K, V>> {
136-
self.indices.clear_no_drop();
136+
self.indices.clear();
137137
self.entries.drain(range)
138138
}
139139

@@ -217,7 +217,7 @@ impl<K, V> IndexMapCore<K, V> {
217217
}
218218

219219
fn rebuild_hash_table(&mut self) {
220-
self.indices.clear_no_drop();
220+
self.indices.clear();
221221
debug_assert!(self.indices.capacity() >= self.entries.len());
222222
for (i, entry) in enumerate(&self.entries) {
223223
// We should never have to reallocate, so there's no need for a real hasher.

0 commit comments

Comments
 (0)