Skip to content

Commit 3c4ac65

Browse files
committed
Updated for loop to calculate count once, as per code review
1 parent 99e5e1a commit 3c4ac65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/File/Csv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function convert(): string
3434
$jsonObjects = array_map(function ($line) use ($splitKeys) {
3535
$values = $this->parseCsv($line);
3636
$jsonObject = [];
37-
for ($valueIndex = 0; $valueIndex < count($values); $valueIndex++) {
37+
for ($valueIndex = 0, $count = count($values); $valueIndex < $count; $valueIndex++) {
3838
if ($values[$valueIndex] == "") {
3939
continue;
4040
}

0 commit comments

Comments
 (0)