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. See gh-31848 Closes gh-31859
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user