Tiny optimizations
This commit is contained in:
parent
e954eb1c20
commit
1547876e97
@ -165,14 +165,14 @@ public abstract class ByteToMessageDecoder extends ChannelInboundHandlerAdapter
|
|||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
throw new DecoderException(t);
|
throw new DecoderException(t);
|
||||||
} finally {
|
} finally {
|
||||||
if (out.isEmpty()) {
|
int size = out.size();
|
||||||
|
if (size == 0) {
|
||||||
decodeWasNull = true;
|
decodeWasNull = true;
|
||||||
}
|
} else {
|
||||||
|
for (int i = 0; i < size; i ++) {
|
||||||
for (int i = 0; i < out.size(); i ++) {
|
|
||||||
ctx.fireChannelRead(out.get(i));
|
ctx.fireChannelRead(out.get(i));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.recycle();
|
out.recycle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,8 +207,8 @@ public abstract class ByteToMessageDecoder extends ChannelInboundHandlerAdapter
|
|||||||
cumulation.release();
|
cumulation.release();
|
||||||
cumulation = null;
|
cumulation = null;
|
||||||
}
|
}
|
||||||
|
int size = out.size();
|
||||||
for (int i = 0; i < out.size(); i ++) {
|
for (int i = 0; i < size; i ++) {
|
||||||
ctx.fireChannelRead(out.get(i));
|
ctx.fireChannelRead(out.get(i));
|
||||||
}
|
}
|
||||||
ctx.fireChannelInactive();
|
ctx.fireChannelInactive();
|
||||||
|
@ -98,7 +98,8 @@ public abstract class MessageToMessageDecoder<I> extends ChannelInboundHandlerAd
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new DecoderException(e);
|
throw new DecoderException(e);
|
||||||
} finally {
|
} finally {
|
||||||
for (int i = 0; i < out.size(); i ++) {
|
int size = out.size();
|
||||||
|
for (int i = 0; i < size; i ++) {
|
||||||
ctx.fireChannelRead(out.get(i));
|
ctx.fireChannelRead(out.get(i));
|
||||||
}
|
}
|
||||||
out.recycle();
|
out.recycle();
|
||||||
|
@ -340,7 +340,8 @@ public abstract class ReplayingDecoder<S> extends ByteToMessageDecoder {
|
|||||||
cumulation = null;
|
cumulation = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < out.size(); i ++) {
|
int size = out.size();
|
||||||
|
for (int i = 0; i < size; i ++) {
|
||||||
ctx.fireChannelRead(out.get(i));
|
ctx.fireChannelRead(out.get(i));
|
||||||
}
|
}
|
||||||
ctx.fireChannelInactive();
|
ctx.fireChannelInactive();
|
||||||
|
Loading…
Reference in New Issue
Block a user