1
0
Fork 0

Merge pull request #5785 from nicolas-grekas/perf

Enhance performance by removing count() from Solver's main loop
pull/5473/merge
Nils Adermann 2016-10-14 16:31:13 +02:00 committed by GitHub
commit 66efc9af86
1 changed files with 5 additions and 2 deletions

View File

@ -758,8 +758,10 @@ class Solver
$systemLevel = $level;
}
for ($i = 0, $n = 0; $n < count($this->rules); $i++, $n++) {
if ($i == count($this->rules)) {
$rulesCount = count($this->rules);
for ($i = 0, $n = 0; $n < $rulesCount; $i++, $n++) {
if ($i == $rulesCount) {
$i = 0;
}
@ -805,6 +807,7 @@ class Solver
}
// something changed, so look at all rules again
$rulesCount = count($this->rules);
$n = -1;
}