File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,11 +274,11 @@ impl Engine {
274274 let watches = if self . value ( var) == & LBool :: True { mem:: take ( & mut self . neg_watches [ var] ) } else { mem:: take ( & mut self . pos_watches [ var] ) } ;
275275 for i in 0 ..watches. len ( ) {
276276 if !self . propagate ( watches[ i] , Lit :: new ( var, self . value ( var) == & LBool :: True ) ) {
277- for j in i.. watches. len ( ) {
277+ for & watch in watches. iter ( ) . skip ( i ) {
278278 if self . value ( var) == & LBool :: True {
279- self . neg_watches [ var] . push ( watches [ j ] ) ;
279+ self . neg_watches [ var] . push ( watch ) ;
280280 } else {
281- self . pos_watches [ var] . push ( watches [ j ] ) ;
281+ self . pos_watches [ var] . push ( watch ) ;
282282 }
283283 }
284284 self . prop_q . clear ( ) ;
@@ -339,7 +339,7 @@ impl Engine {
339339 counter += 1 ;
340340 } else {
341341 // This literal comes from a previous decision level
342- self . learnt . push ( lit. clone ( ) ) ;
342+ self . learnt . push ( * lit) ;
343343 }
344344 }
345345 }
@@ -369,8 +369,7 @@ impl Engine {
369369 }
370370
371371 // 5. Final cleanup - undo all assignments made at this level
372- while !self . propagated_vars . is_empty ( ) {
373- let var = self . propagated_vars . pop ( ) . unwrap ( ) ;
372+ while let Some ( var) = self . propagated_vars . pop ( ) {
374373 self . undo ( var) ;
375374 }
376375 self . undo ( self . decision_var ) ;
You can’t perform that action at this time.
0 commit comments