From 62fd374c364ebb66f4b096e671ffbba2b45b9e41 Mon Sep 17 00:00:00 2001 From: Jason <11360596+jpenilla@users.noreply.github.com> Date: Sat, 4 Dec 2021 23:41:44 -0800 Subject: [PATCH] Remove debug checks from ZeroBitStorage (#7029) --- patches/server/0082-Optimize-DataBits.patch | 36 ++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/patches/server/0082-Optimize-DataBits.patch b/patches/server/0082-Optimize-DataBits.patch index 09c5d79e7..e95ff4c43 100644 --- a/patches/server/0082-Optimize-DataBits.patch +++ b/patches/server/0082-Optimize-DataBits.patch @@ -11,7 +11,7 @@ After: http://i.imgur.com/nJ46crB.png Optimize redundant converting of static fields into an unsigned long each call by precomputing it in ctor diff --git a/src/main/java/net/minecraft/util/SimpleBitStorage.java b/src/main/java/net/minecraft/util/SimpleBitStorage.java -index b74970e3b3e429284099385b2b3d543793f75319..62ec6e7bd99451eb62daf86c05217e4693ce9d20 100644 +index ebfc546d258b92ee02e0e726b9d4dbff6a671d51..6426d6c2c31ead49444fe56e2230266290fa79dd 100644 --- a/src/main/java/net/minecraft/util/SimpleBitStorage.java +++ b/src/main/java/net/minecraft/util/SimpleBitStorage.java @@ -11,8 +11,8 @@ public class SimpleBitStorage implements BitStorage { @@ -82,3 +82,37 @@ index b74970e3b3e429284099385b2b3d543793f75319..62ec6e7bd99451eb62daf86c05217e46 int i = this.cellIndex(index); long l = this.data[i]; int j = (index - i * this.valuesPerLong) * this.bits; +diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java +index 172e7a0761724cc802387e613258830a0defb04a..9686ce7536c9924b1b2aced4f013f46759cbc72e 100644 +--- a/src/main/java/net/minecraft/util/ZeroBitStorage.java ++++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java +@@ -13,21 +13,21 @@ public class ZeroBitStorage implements BitStorage { + } + + @Override +- public int getAndSet(int index, int value) { +- Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); +- Validate.inclusiveBetween(0L, 0L, (long)value); ++ public final int getAndSet(int index, int value) { // Paper - make final for inline ++ //Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); // Paper ++ //Validate.inclusiveBetween(0L, 0L, (long)value); // Paper + return 0; + } + + @Override +- public void set(int index, int value) { +- Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); +- Validate.inclusiveBetween(0L, 0L, (long)value); ++ public final void set(int index, int value) { // Paper - make final for inline ++ //Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); // Paper ++ //Validate.inclusiveBetween(0L, 0L, (long)value); // Paper + } + + @Override +- public int get(int index) { +- Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); ++ public final int get(int index) { // Paper - make final for inline ++ //Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)index); // Paper + return 0; + } +