geforkt von Mirrors/Velocity
Fix a few areas of concern spotted by JITWatch
Dieser Commit ist enthalten in:
Ursprung
7e1f01f13a
Commit
62703780e1
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren