Skip to content

Commit a9101fd

Browse files
author
James Cor
committed
use cap
1 parent 8738d0c commit a9101fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/byte_buffer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ func NewByteBuffer(initCap int) *ByteBuffer {
4141
// they expect to be protected.
4242
func (b *ByteBuffer) Grow(n int) {
4343
newI := b.i
44-
if b.i+n <= cap(b.buf) {
44+
if b.i+n < cap(b.buf) {
4545
// Increment |b.i| if no alloc
4646
newI += n
47-
} else if b.i+n >= cap(b.buf) {
47+
} else {
4848
// No more space, double.
4949
// An external allocation doubled the cap using the size of
5050
// the override object, which if used could lead to overall

0 commit comments

Comments
 (0)