Skip to content

Commit ed6bc4a

Browse files
committed
Update parser.ts
1 parent 44b4a8c commit ed6bc4a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/pg-protocol/src/parser.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ export class Parser {
106106
break
107107
}
108108
}
109-
if(buffer === this.buffer) {
110-
this.buffer = Buffer.from(this.buffer)
111-
}
112109
if (offset === bufferFullLength) {
113110
// No more use for the buffer
114111
this.buffer = emptyBuffer
@@ -148,7 +145,7 @@ export class Parser {
148145
buffer.copy(this.buffer, this.bufferOffset + this.bufferLength)
149146
this.bufferLength = newLength
150147
} else {
151-
this.buffer = buffer
148+
this.buffer = Buffer.from(buffer)
152149
this.bufferOffset = 0
153150
this.bufferLength = buffer.byteLength
154151
}

0 commit comments

Comments
 (0)