Skip to content

Commit

Permalink
Use array_combine() instead of manual iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Oct 13, 2018
1 parent 237fbf4 commit f6b4f1a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/PgSqlResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,7 @@ public function getCurrent(): array
$result[$column] = $this->cast($column, $result[$column]);
}

$assoc = [];
foreach ($this->fieldNames as $index => $name) {
$assoc[$name] = $result[$index];
}

return $this->currentRow = $assoc;
return $this->currentRow = \array_combine($this->fieldNames, $result);
}

/**
Expand Down

0 comments on commit f6b4f1a

Please sign in to comment.