@@ -46,7 +46,7 @@ impl<K, V> IndexMapCore<K, V> {
46
46
47
47
pub ( super ) fn erase_index ( & mut self , hash : HashValue , index : usize ) {
48
48
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) } ;
50
50
}
51
51
52
52
pub ( crate ) fn entry ( & mut self , hash : HashValue , key : K ) -> Entry < K , V >
@@ -99,10 +99,7 @@ impl<K, V> IndexMapCore<K, V> {
99
99
unsafe fn shift_remove_bucket ( & mut self , raw_bucket : RawBucket ) -> ( usize , K , V ) {
100
100
// use Vec::remove, but then we need to update the indices that point
101
101
// 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) } ;
106
103
let entry = self . entries . remove ( index) ;
107
104
108
105
// correct indices that point to the entries that followed the removed entry.
@@ -160,10 +157,7 @@ impl<K, V> IndexMapCore<K, V> {
160
157
unsafe fn swap_remove_bucket ( & mut self , raw_bucket : RawBucket ) -> ( usize , K , V ) {
161
158
// use swap_remove, but then we need to update the index that points
162
159
// 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) } ;
167
161
let entry = self . entries . swap_remove ( index) ;
168
162
169
163
// correct index that points to the entry that had to swap places
0 commit comments