aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0950-Optimize-VarInts.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0950-Optimize-VarInts.patch')
-rw-r--r--patches/server/0950-Optimize-VarInts.patch8
1 files changed, 4 insertions, 4 deletions
diff --git a/patches/server/0950-Optimize-VarInts.patch b/patches/server/0950-Optimize-VarInts.patch
index 19e7fc574a..b96957d432 100644
--- a/patches/server/0950-Optimize-VarInts.patch
+++ b/patches/server/0950-Optimize-VarInts.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Optimize VarInts
https://github.com/PaperMC/Paper/pull/6957#issuecomment-985250854
diff --git a/src/main/java/net/minecraft/network/VarInt.java b/src/main/java/net/minecraft/network/VarInt.java
-index 18d5a22ad3ef4cb279475531dbc2c65e07c69929..3f362eb42587b333e27b9cf25588a9cfcb8a56e7 100644
+index 49a8ddc269d53458cfbd639b7de838c2e5765748..74ed47659d3e615c2dae7da98d5a8cf1559625bf 100644
--- a/src/main/java/net/minecraft/network/VarInt.java
+++ b/src/main/java/net/minecraft/network/VarInt.java
@@ -9,6 +9,18 @@ public class VarInt {
@@ -24,8 +24,8 @@ index 18d5a22ad3ef4cb279475531dbc2c65e07c69929..3f362eb42587b333e27b9cf25588a9cf
+ VARINT_EXACT_BYTE_LENGTHS[32] = 1; // Special case for the number 0.
+ }
+ public static int getByteSizeOld(int i) {
-+ //Paper end - Optimize VarInts
- for(int j = 1; j < 5; ++j) {
++ // Paper end - Optimize VarInts
+ for (int j = 1; j < 5; j++) {
if ((i & -1 << j * 7) == 0) {
return j;
@@ -39,6 +51,21 @@ public class VarInt {
@@ -47,6 +47,6 @@ index 18d5a22ad3ef4cb279475531dbc2c65e07c69929..3f362eb42587b333e27b9cf25588a9cf
+ }
+ public static ByteBuf writeOld(ByteBuf buf, int i) {
+ // Paper end - Optimize VarInts
- while((i & -128) != 0) {
+ while ((i & -128) != 0) {
buf.writeByte(i & 127 | 128);
i >>>= 7;