#3113: Remove unnecessary slice in PacketDecompressor
Thanks @lokha for the profiling and suggestion.
This commit is contained in:
parent
b7935d4b14
commit
c57bf61114
@ -31,8 +31,7 @@ public class PacketDecompressor extends MessageToMessageDecoder<ByteBuf>
|
|||||||
int size = DefinedPacket.readVarInt( in );
|
int size = DefinedPacket.readVarInt( in );
|
||||||
if ( size == 0 )
|
if ( size == 0 )
|
||||||
{
|
{
|
||||||
out.add( in.slice().retain() );
|
out.add( in );
|
||||||
in.skipBytes( in.readableBytes() );
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
ByteBuf decompressed = ctx.alloc().directBuffer();
|
ByteBuf decompressed = ctx.alloc().directBuffer();
|
||||||
|
Loading…
Reference in New Issue
Block a user