File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -679,12 +679,19 @@ package body AdaSAT.DPLL is
679679 begin
680680 if Lit_Decisions (Var) = Decision_Level then
681681 Found := Found + 1 ;
682- -- TODO: exit if Found > 1?
683- if Pivot = 0 and then
684- Lit_Antecedents (Var) /= null
685- then
686- Pivot := Var;
687- Pivot_Index := Lit_Index;
682+ if Pivot = 0 then
683+ if Lit_Antecedents (Var) /= null then
684+ Pivot := Var;
685+ Pivot_Index := Lit_Index;
686+ end if ;
687+ elsif Found > 1 then
688+ -- We know there are at least two pivots and we
689+ -- already selected one (since ``Pivot /= 0``), so we
690+ -- can exit early from this internal loop to save some
691+ -- cycles. This is OK because we don't need to know
692+ -- how many potential pivots there were, only that
693+ -- there were more than one.
694+ exit ;
688695 end if ;
689696 end if ;
690697 end ;
You can’t perform that action at this time.
0 commit comments