mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpiutil] ProtobufBuffer: Fix buffer reallocation (#5924)
This commit is contained in:
@@ -61,7 +61,7 @@ public final class ProtobufBuffer<T, MessageType extends ProtoMessage<?>> {
|
||||
m_msg.clearQuick();
|
||||
m_proto.pack(m_msg, value);
|
||||
int size = m_msg.getSerializedSize();
|
||||
if (size < m_buf.capacity()) {
|
||||
if (size > m_buf.capacity()) {
|
||||
m_buf = ByteBuffer.allocateDirect(size * 2);
|
||||
m_sink.setOutput(m_buf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user