optimizing loops
parent
e43d0b5a5b
commit
c6c521bfae
|
@ -677,8 +677,8 @@ class Solver
|
|||
$systemLevel = $level;
|
||||
}
|
||||
|
||||
for ($i = 0, $n = 0; $n < count($this->rules); $i++, $n++) {
|
||||
if ($i == count($this->rules)) {
|
||||
for ($i = 0, $n = 0, $count = count($this->rules); $n < $count; $i++, $n++) {
|
||||
if ($i == $count) {
|
||||
$i = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -372,7 +372,7 @@ class VersionParser
|
|||
$pairs = array_values($pairs);
|
||||
$result = array();
|
||||
|
||||
for ($i = 0; $i < count($pairs); $i++) {
|
||||
for ($i = 0, $count = count($pairs); $i < $count; $i++) {
|
||||
$pair = preg_replace('{^([^=: ]+)[=: ](.*)$}', '$1 $2', trim($pairs[$i]));
|
||||
if (false === strpos($pair, ' ') && isset($pairs[$i+1]) && false === strpos($pairs[$i+1], '/')) {
|
||||
$pair .= ' '.$pairs[$i+1];
|
||||
|
|
Loading…
Reference in New Issue