Skip to content

Commit

Permalink
remove a while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
chadicus committed Jan 22, 2015
1 parent c2041fd commit d606643
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DOMUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ private static function addXPath(DOMDocument $document, $xpath, $value = null)
continue;
}

while ($list->length < $count) {
$node = $document->createElement($tagName);
$pointer->appendChild($node);
$list = $domXPath->query($path, $pointer);
for ($i = 0; $i < $count - $list->length; $i++) {
$pointer->appendChild($document->createElement($tagName));
}

$list = $domXPath->query($path, $pointer);

$pointer = $list->item($count -1);
}

Expand Down

0 comments on commit d606643

Please sign in to comment.