Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
perf(result): avoid unnecessary operation
  • Loading branch information
nigrosimone committed Sep 13, 2025
commit b5806f471ee0b89884d98682e16d633c7fdcdd82
7 changes: 2 additions & 5 deletions packages/pg/lib/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,9 @@ class Result {
const row = { ...this._prebuiltEmptyResultObject }
for (let i = 0, len = rowData.length; i < len; i++) {
const rawValue = rowData[i]
const field = this.fields[i].name
if (rawValue !== null) {
const v = this.fields[i].format === 'binary' ? Buffer.from(rawValue) : rawValue
row[field] = this._parsers[i](v)
} else {
row[field] = null
const field = this.fields[i]
row[field.name] = this._parsers[i](field.format === 'binary' ? Buffer.from(rawValue) : rawValue)
}
}
return row
Expand Down
Loading