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