Reuse single instance of PacketByteBuffer

This commit is contained in:
filoghost 2021-07-25 19:14:29 +02:00
parent 6be5f00f53
commit 51b0f7fd30

View File

@ -13,8 +13,11 @@ import java.util.UUID;
class PacketByteBuffer extends PacketDataSerializer {
private static final PacketByteBuffer INSTANCE = new PacketByteBuffer();
static PacketByteBuffer get() {
return new PacketByteBuffer(); // TODO try to clear and re-use a single instance
INSTANCE.clear();
return INSTANCE;
}
private PacketByteBuffer() {