Remove some dead code

This commit is contained in:
Norman Maurer 2013-08-11 21:37:43 +02:00
parent 73755d1233
commit 7d31943326
2 changed files with 6 additions and 9 deletions

View File

@ -102,13 +102,11 @@ public abstract class MessageToByteEncoder<I> extends ChannelOutboundHandlerAdap
if (acceptOutboundMessage(msg)) { if (acceptOutboundMessage(msg)) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
I cast = (I) msg; I cast = (I) msg;
if (buf == null) {
if (preferDirect) { if (preferDirect) {
buf = ctx.alloc().ioBuffer(); buf = ctx.alloc().ioBuffer();
} else { } else {
buf = ctx.alloc().heapBuffer(); buf = ctx.alloc().heapBuffer();
} }
}
try { try {
encode(ctx, cast, buf); encode(ctx, cast, buf);
} finally { } finally {

View File

@ -190,13 +190,12 @@ public class JdkZlibEncoder extends ZlibEncoder {
} }
@Override @Override
protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception { protected void encode(ChannelHandlerContext ctx, ByteBuf uncompressed, ByteBuf out) throws Exception {
if (finished) { if (finished) {
out.writeBytes(in); out.writeBytes(uncompressed);
return; return;
} }
ByteBuf uncompressed = in;
byte[] inAry = new byte[uncompressed.readableBytes()]; byte[] inAry = new byte[uncompressed.readableBytes()];
uncompressed.readBytes(inAry); uncompressed.readBytes(inAry);