perf(pg): avoid useless spread (#3379)

* perf(pg): avoid useless spread

* fix: missing initialization
This commit is contained in:
francesco 2025-02-11 17:13:15 +01:00 committed by GitHub
parent f1586932fd
commit 5f6a6e6596
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 }
}
}