Correctly set capacity of remainder in DefaultDataBuffer::split

This commit ensures that the capacity of the remainder buffer after a
split operation is set directly on the field. Calling capacity(int)
caused a new buffer to be allocated.

Closes gh-31848
This commit is contained in:
Arjen Poutsma 2023-12-18 11:43:18 +01:00
parent 22bf4df290
commit 1ff683b259
1 changed files with 1 additions and 1 deletions

View File

@ -371,7 +371,7 @@ public class DefaultDataBuffer implements DataBuffer {
.slice();
this.writePosition = Math.max(this.writePosition, index) - index;
this.readPosition = Math.max(this.readPosition, index) - index;
capacity(this.byteBuffer.capacity());
this.capacity = this.byteBuffer.capacity();
return result;
}