From 2e6f0dd442200a4c2a3862a505cd060437ee3638 Mon Sep 17 00:00:00 2001 From: Janmm14 Date: Thu, 23 Mar 2023 10:57:53 +0100 Subject: [PATCH] #3450: Use readRetainedSlice method instead of slice+retain+skip --- .../java/net/md_5/bungee/protocol/Varint21FrameDecoder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java index 647394ba..277e70e8 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Varint21FrameDecoder.java @@ -53,8 +53,7 @@ public class Varint21FrameDecoder extends ByteToMessageDecoder { if ( in.hasMemoryAddress() ) { - out.add( in.slice( in.readerIndex(), length ).retain() ); - in.skipBytes( length ); + out.add( in.readRetainedSlice( length ) ); } else { if ( !DIRECT_WARNING )