@@ -46,7 +46,7 @@ impl<K, V> IndexMapCore<K, V> {
4646
4747 pub ( super ) fn erase_index ( & mut self , hash : HashValue , index : usize ) {
4848 let raw_bucket = self . find_index ( hash, index) . unwrap ( ) ;
49- unsafe { self . indices . erase_no_drop ( & raw_bucket) } ;
49+ unsafe { self . indices . erase ( raw_bucket) } ;
5050 }
5151
5252 pub ( crate ) fn entry ( & mut self , hash : HashValue , key : K ) -> Entry < K , V >
@@ -99,10 +99,7 @@ impl<K, V> IndexMapCore<K, V> {
9999 unsafe fn shift_remove_bucket ( & mut self , raw_bucket : RawBucket ) -> ( usize , K , V ) {
100100 // use Vec::remove, but then we need to update the indices that point
101101 // to all of the other entries that have to move
102- let index = unsafe {
103- self . indices . erase_no_drop ( & raw_bucket) ;
104- raw_bucket. read ( )
105- } ;
102+ let index = unsafe { self . indices . remove ( raw_bucket) } ;
106103 let entry = self . entries . remove ( index) ;
107104
108105 // correct indices that point to the entries that followed the removed entry.
@@ -160,10 +157,7 @@ impl<K, V> IndexMapCore<K, V> {
160157 unsafe fn swap_remove_bucket ( & mut self , raw_bucket : RawBucket ) -> ( usize , K , V ) {
161158 // use swap_remove, but then we need to update the index that points
162159 // to the other entry that has to move
163- let index = unsafe {
164- self . indices . erase_no_drop ( & raw_bucket) ;
165- raw_bucket. read ( )
166- } ;
160+ let index = unsafe { self . indices . remove ( raw_bucket) } ;
167161 let entry = self . entries . swap_remove ( index) ;
168162
169163 // correct index that points to the entry that had to swap places
0 commit comments