Skip to content

Commit 669826a

Browse files
committed
Slightly more efficient hex bytea decode
1 parent 9b078ed commit 669826a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/textParsers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ var parseInterval = function(val) {
119119
};
120120

121121
var parseByteA = function(val) {
122-
if(val.match(/^\\x/)){
122+
if(/^\\x/.test(val)){
123123
// new 'hex' style response (pg >9.0)
124-
return new Buffer(val.replace(/^\\x/,''), 'hex');
124+
return new Buffer(val.substr(2), 'hex');
125125
}else{
126126
out = ""
127127
i = 0

0 commit comments

Comments
 (0)