Small simplification to WriteTask optimization (#9807)

Motiviation

#9800 was just merged which consolidates the flush/no-flush WriteTasks
in AbstractChannelHandlerContext, but after looking at the changes again
I noticed a tiny simplification that would be good to make imo.

Modification

Remove use of conditional operator in decrementPendingOutboundBytes()

Result

Simpler code, one less branch
This commit is contained in:
Nick Hill 2019-11-26 21:55:22 -08:00 committed by Norman Maurer
parent 2886bd6677
commit 6d0c0e991b

View File

@ -1109,7 +1109,7 @@ abstract class AbstractChannelHandlerContext implements ChannelHandlerContext, R
private void decrementPendingOutboundBytes() {
if (ESTIMATE_TASK_SIZE_ON_SUBMIT) {
ctx.pipeline.decrementPendingOutboundBytes(size >= 0 ? size : (size & Integer.MAX_VALUE));
ctx.pipeline.decrementPendingOutboundBytes(size & Integer.MAX_VALUE);
}
}