Only create UnsafeDynamicChannelBuffer if really needed. See #108
This commit is contained in:
parent
3b368125b0
commit
081395410d
@ -567,9 +567,10 @@ public abstract class ReplayingDecoder<T extends Enum<T>>
|
||||
private ChannelBuffer cumulation(ChannelHandlerContext ctx) {
|
||||
ChannelBuffer buf = this.cumulation;
|
||||
if (buf == null) {
|
||||
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
|
||||
buf = new UnsafeDynamicChannelBuffer(factory);
|
||||
|
||||
if (cumulation == null) {
|
||||
ChannelBufferFactory factory = ctx.getChannel().getConfig().getBufferFactory();
|
||||
buf = new UnsafeDynamicChannelBuffer(factory);
|
||||
cumulation = buf;
|
||||
replayable = new ReplayingDecoderBuffer(buf);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user