Skip to content

Commit 5f6a6e6

Browse files
authored
perf(pg): avoid useless spread (#3379)
* perf(pg): avoid useless spread * fix: missing initialization
1 parent f158693 commit 5f6a6e6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/pg/lib/result.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,18 @@ class Result {
8888
this._parsers = new Array(fieldDescriptions.length)
8989
}
9090

91-
var row = {}
91+
this._prebuiltEmptyResultObject = {}
9292

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

9797
if (this._types) {
9898
this._parsers[i] = this._types.getTypeParser(desc.dataTypeID, desc.format || 'text')
9999
} else {
100100
this._parsers[i] = types.getTypeParser(desc.dataTypeID, desc.format || 'text')
101101
}
102102
}
103-
this._prebuiltEmptyResultObject = { ...row }
104103
}
105104
}
106105

0 commit comments

Comments
 (0)