File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -111,19 +111,18 @@ impl RedundantMoveEliminator {
111
111
pub fn clear_alloc ( & mut self , alloc : Allocation ) {
112
112
trace ! ( " redundant move eliminator: clear {:?}" , alloc) ;
113
113
if let Some ( ref mut existing_copies) = self . reverse_allocs . get_mut ( & alloc) {
114
- for to_inval in existing_copies. iter ( ) {
114
+ for to_inval in existing_copies. drain ( .. ) {
115
115
trace ! ( " -> clear existing copy: {:?}" , to_inval) ;
116
- if let Some ( val) = self . allocs . get_mut ( to_inval) {
116
+ if let Some ( val) = self . allocs . get_mut ( & to_inval) {
117
117
match val {
118
118
RedundantMoveState :: Copy ( _, Some ( vreg) ) => {
119
119
* val = RedundantMoveState :: Orig ( * vreg) ;
120
120
}
121
121
_ => * val = RedundantMoveState :: None ,
122
122
}
123
123
}
124
- self . allocs . remove ( to_inval) ;
124
+ self . allocs . remove ( & to_inval) ;
125
125
}
126
- existing_copies. clear ( ) ;
127
126
}
128
127
self . allocs . remove ( & alloc) ;
129
128
}
You can’t perform that action at this time.
0 commit comments