mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
perf(pg): avoid useless spread (#3379)
* perf(pg): avoid useless spread * fix: missing initialization
This commit is contained in:
parent
f1586932fd
commit
5f6a6e6596
@ -88,11 +88,11 @@ 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')
|
||||
@ -100,7 +100,6 @@ class Result {
|
||||
this._parsers[i] = types.getTypeParser(desc.dataTypeID, desc.format || 'text')
|
||||
}
|
||||
}
|
||||
this._prebuiltEmptyResultObject = { ...row }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user