1
0
mirror of https://github.com/danog/postgres.git synced 2024-11-30 04:29:12 +01:00

Use array_combine() instead of manual iteration

This commit is contained in:
Aaron Piotrowski 2018-10-13 10:22:23 -05:00
parent 237fbf413c
commit f6b4f1a991
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -94,12 +94,7 @@ final class PgSqlResultSet implements ResultSet
$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);
}
/**