From f03c32e137dd89ec91fae04d112e9660a08f65d1 Mon Sep 17 00:00:00 2001 From: Michael Nitschinger Date: Mon, 2 Dec 2013 13:01:51 +0100 Subject: [PATCH] [codec-memcache] encode key directly, no need to use unpooled. --- .../codec/memcache/binary/BinaryMemcacheEncoder.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/BinaryMemcacheEncoder.java b/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/BinaryMemcacheEncoder.java index 11aaa7616f..61d560c35b 100644 --- a/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/BinaryMemcacheEncoder.java +++ b/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/BinaryMemcacheEncoder.java @@ -16,7 +16,6 @@ package io.netty.handler.codec.memcache.binary; import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToByteEncoder; import io.netty.handler.codec.memcache.MemcacheObjectEncoder; @@ -64,12 +63,7 @@ public abstract class BinaryMemcacheEncoder, return; } - ByteBuf keyBuf = Unpooled.copiedBuffer(key, CharsetUtil.UTF_8); - try { - buf.writeBytes(keyBuf); - } finally { - keyBuf.release(); - } + buf.writeBytes(key.getBytes(CharsetUtil.UTF_8)); } /**