Skip to content

Commit 073f650

Browse files
committed
Extract the count function from the for loop.
1 parent e4f7372 commit 073f650

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

composer-lock-diff

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ function tableize($header, $data, $opts = array()) {
8787

8888
$widths = array(maxLength(array_merge(array($header), array_keys($data))));
8989

90-
for($i = 0; $i < count(reset($data)); $i++) {
90+
$count = count(reset($data));
91+
for($i = 0; $i < $count; $i++) {
9192
$widths[] = maxLength(array_map(function($k) use ($data, $i) { return $data[$k][$i]; }, array_keys($data)));
9293
}
9394

0 commit comments

Comments
 (0)