13
0
geforkt von Mirrors/Velocity

Fix a few areas of concern spotted by JITWatch

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-06-27 21:33:05 -04:00
Ursprung 7e1f01f13a
Commit 62703780e1
3 geänderte Dateien mit 1 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -48,8 +48,6 @@ public class LibdeflateVelocityCompressor implements VelocityCompressor {
@Override
public void deflate(ByteBuf source, ByteBuf destination) throws DataFormatException {
ensureNotDisposed();
source.memoryAddress();
destination.memoryAddress();
while (true) {
long sourceAddress = source.memoryAddress() + source.readerIndex();

Datei anzeigen

@ -31,7 +31,6 @@ public class NativeVelocityCipher implements VelocityCipher {
@Override
public void process(ByteBuf source) {
ensureNotDisposed();
source.memoryAddress();
long base = source.memoryAddress() + source.readerIndex();
int len = source.readableBytes();

Datei anzeigen

@ -41,8 +41,7 @@ public class MinecraftCompressEncoder extends MessageToByteEncoder<ByteBuf> {
// Follow the advice of https://github.com/ebiggers/libdeflate/blob/master/libdeflate.h#L103
// here for compression. The maximum buffer size if the data compresses well (which is almost
// always the case) is one less the input buffer.
int offset = msg.readableBytes() < threshold ? 1 : -1;
int initialBufferSize = msg.readableBytes() + offset;
int initialBufferSize = msg.readableBytes() + 1;
return MoreByteBufUtils.preferredBuffer(ctx.alloc(), compressor, initialBufferSize);
}