Skip to content

Commit

Permalink
perf(pg): avoid useless spread (#3379)
Browse files Browse the repository at this point in the history
* perf(pg): avoid useless spread

* fix: missing initialization
  • Loading branch information
cesco69 authored Feb 11, 2025
1 parent f158693 commit 5f6a6e6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/pg/lib/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,18 @@ class Result {
this._parsers = new Array(fieldDescriptions.length)
}

var row = {}
this._prebuiltEmptyResultObject = {}

for (var i = 0; i < fieldDescriptions.length; i++) {
var desc = fieldDescriptions[i]
row[desc.name] = null
this._prebuiltEmptyResultObject[desc.name] = null

if (this._types) {
this._parsers[i] = this._types.getTypeParser(desc.dataTypeID, desc.format || 'text')
} else {
this._parsers[i] = types.getTypeParser(desc.dataTypeID, desc.format || 'text')
}
}
this._prebuiltEmptyResultObject = { ...row }
}
}

Expand Down

0 comments on commit 5f6a6e6

Please sign in to comment.