#3450: Use readRetainedSlice method instead of slice+retain+skip

This commit is contained in:
Janmm14 2023-03-23 10:57:53 +01:00 committed by GitHub
parent 7790783949
commit 2e6f0dd442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,8 +53,7 @@ public class Varint21FrameDecoder extends ByteToMessageDecoder
{ {
if ( in.hasMemoryAddress() ) if ( in.hasMemoryAddress() )
{ {
out.add( in.slice( in.readerIndex(), length ).retain() ); out.add( in.readRetainedSlice( length ) );
in.skipBytes( length );
} else } else
{ {
if ( !DIRECT_WARNING ) if ( !DIRECT_WARNING )