Skip to content

Commit

Permalink
perf: short control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nigrosimone committed Jun 6, 2024
1 parent 72c11dd commit 58be255
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/pg-native/lib/build-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ class Result {

readValue(pq, rowIndex, colIndex) {
var rawValue = pq.getvalue(rowIndex, colIndex)
if (rawValue === '') {
if (pq.getisnull(rowIndex, colIndex)) {
return null
}
if (rawValue === '' && pq.getisnull(rowIndex, colIndex)) {
return null
}
const dataTypeId = this.fields[colIndex].dataTypeID
return this._types.getTypeParser(dataTypeId)(rawValue)
Expand Down

0 comments on commit 58be255

Please sign in to comment.