Skip to content

Commit 33d077f

Browse files
author
Matt
committed
Improvements to performance for checking to useBinary. 1875
1 parent 6b8176e commit 33d077f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/connection.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ Connection.prototype.bind = function (config, more) {
266266
var values = config.values || []
267267
var len = values.length
268268
var useBinary = false
269-
for (var j = 0; j < len; j++) { useBinary |= values[j] instanceof Buffer }
269+
for (var j = 0; j < len; j++) {
270+
useBinary |= values[j] instanceof Buffer
271+
if (useBinary) break
272+
}
270273
var buffer = this.writer
271274
.addCString(config.portal)
272275
.addCString(config.statement)

0 commit comments

Comments
 (0)