Move another sizeof out of the loop. See #7147.

git-svn-id: https://develop.svn.wordpress.org/trunk@8118 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-06-18 06:48:48 +00:00
parent a1c42c6c0b
commit 5abf4bfe1b
1 changed files with 3 additions and 1 deletions

View File

@ -510,12 +510,14 @@ class Walker {
if ( !$top_level_elements ) { if ( !$top_level_elements ) {
$root = $children_elements[0]; $root = $children_elements[0];
for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) { $num_elements = sizeof($children_elements);
for ( $i = 0; $i < $num_elements; $i++ ) {
$child = $children_elements[$i]; $child = $children_elements[$i];
if ($root->$parent_field == $child->$parent_field ) { if ($root->$parent_field == $child->$parent_field ) {
$top_level_elements[] = $child; $top_level_elements[] = $child;
array_splice( $children_elements, $i, 1 ); array_splice( $children_elements, $i, 1 );
$num_elements--;
$i--; $i--;
} }
} }