From f45a727396392e4a81f73d225ac72e5fc5a3bb05 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Thu, 17 Jan 2019 04:30:34 -0200 Subject: [PATCH] remove short array used for checking if array is empty --- .../storage/BlockConnectionStorage.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockConnectionStorage.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockConnectionStorage.java index 2972b33ad..b7e5c5da6 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockConnectionStorage.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockConnectionStorage.java @@ -7,13 +7,11 @@ import us.myles.ViaVersion.api.minecraft.Position; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; public class BlockConnectionStorage extends StoredObject { private Map blockStorage = createLongObjectMap(); - private static short[] short4096 = new short[4096]; private static Constructor fastUtilLongObjectHashMap; @@ -48,9 +46,10 @@ public class BlockConnectionStorage extends StoredObject { short[] map = blockStorage.get(pair); if (map == null) return; map[encodeBlockPos(position)] = 0; - if (Arrays.equals(short4096, map)) { - blockStorage.remove(pair); + for (short entry : map) { + if (entry != 0) return; } + blockStorage.remove(pair); } public void clear() {