Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request zendframework/zendframework#7413 from samsonasik/p…
Browse files Browse the repository at this point in the history
…erformance-loop

increase loop performance by assign count() to variable
  • Loading branch information
weierophinney committed May 4, 2015
3 parents 61e9069 + aeee471 + 6023e22 commit f9afcef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Dn.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ public static function explodeDn(
}
$ret = array();
for ($i = 0, $count = count($k); $i < $count; $i++) {
if (is_array($k[$i]) && is_array($v[$i]) && (count($k[$i]) === count($v[$i]))) {
if (is_array($k[$i]) && is_array($v[$i]) && (($keyCount = count($k[$i])) === count($v[$i]))) {
$multi = array();
for ($j = 0; $j < count($k[$i]); $j++) {
for ($j = 0; $j < $keyCount; $j++) {
$key = $k[$i][$j];
$val = $v[$i][$j];
$multi[$key] = $val;
Expand Down

0 comments on commit f9afcef

Please sign in to comment.