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 {
111111 pub fn clear_alloc ( & mut self , alloc : Allocation ) {
112112 trace ! ( " redundant move eliminator: clear {:?}" , alloc) ;
113113 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 ( .. ) {
115115 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) {
117117 match val {
118118 RedundantMoveState :: Copy ( _, Some ( vreg) ) => {
119119 * val = RedundantMoveState :: Orig ( * vreg) ;
120120 }
121121 _ => * val = RedundantMoveState :: None ,
122122 }
123123 }
124- self . allocs . remove ( to_inval) ;
124+ self . allocs . remove ( & to_inval) ;
125125 }
126- existing_copies. clear ( ) ;
127126 }
128127 self . allocs . remove ( & alloc) ;
129128 }
You can’t perform that action at this time.
0 commit comments