mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2025-01-01 21:57:36 +01:00
Reuse single instance of PacketByteBuffer
This commit is contained in:
parent
6be5f00f53
commit
51b0f7fd30
@ -13,8 +13,11 @@ import java.util.UUID;
|
|||||||
|
|
||||||
class PacketByteBuffer extends PacketDataSerializer {
|
class PacketByteBuffer extends PacketDataSerializer {
|
||||||
|
|
||||||
|
private static final PacketByteBuffer INSTANCE = new PacketByteBuffer();
|
||||||
|
|
||||||
static PacketByteBuffer get() {
|
static PacketByteBuffer get() {
|
||||||
return new PacketByteBuffer(); // TODO try to clear and re-use a single instance
|
INSTANCE.clear();
|
||||||
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PacketByteBuffer() {
|
private PacketByteBuffer() {
|
||||||
|
Loading…
Reference in New Issue
Block a user