mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Enhance solver perf by removing count()
This commit is contained in:
parent
aa051ba4f0
commit
daf84bea33
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue