Sfoglia il codice sorgente

Merge pull request #352 from naderman/positive-branch-levels

Levels are always > 0, negative level was just a hack in the C implementation
Jordi Boggiano 13 anni fa
parent
commit
2aa61292ae
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/Composer/DependencyResolver/Solver.php

+ 2 - 2
src/Composer/DependencyResolver/Solver.php

@@ -1393,7 +1393,7 @@ class Solver
 
         // if there are multiple candidates, then branch
         if (count($literals)) {
-            $this->branches[] = array($literals, -$level);
+            $this->branches[] = array($literals, $level);
         }
 
         return $this->setPropagateLearn($level, $selectedLiteral, $disableRules, $rule);
@@ -1996,7 +1996,7 @@ class Solver
                     $level = $lastLevel;
                     $this->revert($level);
 
-                    $why = $this->decisionQueueWhy[count($this->decisionQueueWhy)];
+                    $why = $this->decisionQueueWhy[count($this->decisionQueueWhy) - 1];
 
                     $oLevel = $level;
                     $level = $this->setPropagateLearn($level, $lastLiteral, $disableRules, $why);