Begin remigrate to Shiroha
uhm
This commit is contained in:
+6
-6
@@ -17,7 +17,7 @@ index 8b778744a5f01943976f180ad340a1cbce7db506..f3e514d801ab14d3baaf1943b7cbca1b
|
||||
}
|
||||
|
||||
public static void write(final ByteBuf output, final CharSequence value, final int maxLength) {
|
||||
+ // Camellia start - Krypton optimizations
|
||||
+ // Shiroha start - Krypton optimizations
|
||||
+ if (true) {
|
||||
+ if (value.length() > maxLength) {
|
||||
+ throw new EncoderException("String too big (was " + value.length() + " characters, max " + maxLength + ")");
|
||||
@@ -32,7 +32,7 @@ index 8b778744a5f01943976f180ad340a1cbce7db506..f3e514d801ab14d3baaf1943b7cbca1b
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ // Camellia end
|
||||
+ // Shiroha end
|
||||
if (value.length() > maxLength) {
|
||||
throw new EncoderException("String too big (was " + value.length() + " characters, max " + maxLength + ")");
|
||||
}
|
||||
@@ -45,8 +45,8 @@ index 1428ce80e8316a24cfca7b6aafdea8588a5a790e..740182c0b1c6918e81a45dddba1c4f48
|
||||
output.writeShort(s);
|
||||
} else {
|
||||
- writeSlow(output, value);
|
||||
+ // writeSlow(output, value); // Camellia - Krypton optimizations
|
||||
+ writeVarIntFull(output, value); // Camellia - Krypton optimizations
|
||||
+ // writeSlow(output, value); // Shiroha - Krypton optimizations
|
||||
+ writeVarIntFull(output, value); // Shiroha - Krypton optimizations
|
||||
}
|
||||
return output;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ index 1428ce80e8316a24cfca7b6aafdea8588a5a790e..740182c0b1c6918e81a45dddba1c4f48
|
||||
output.writeByte(value);
|
||||
return output;
|
||||
}
|
||||
+ // Camellia start - Krypton optimizations
|
||||
+ // Shiroha start - Krypton optimizations
|
||||
+ private static void writeVarIntFull(ByteBuf buf, int value) {
|
||||
+ // See https://steinborn.me/posts/performance/how-fast-can-you-write-a-varint/
|
||||
+ if ((value & (0xFFFFFFFF << 7)) == 0) {
|
||||
@@ -76,5 +76,5 @@ index 1428ce80e8316a24cfca7b6aafdea8588a5a790e..740182c0b1c6918e81a45dddba1c4f48
|
||||
+ buf.writeByte(value >>> 28);
|
||||
+ }
|
||||
+ }
|
||||
+ // Camellia end
|
||||
+ // Shiroha end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user