Deleting redundant needsFlush boolean
Motivation: In ChunkedWriteHandler, there is a redundant variable that servers no purpose. It implies that under some conditions you might not want to flush. Modifications: Removed the variable and the if condition that read it. The boolean was always true so just removing the if statement was fine. Result: Slightly less misleading code.
This commit is contained in:
parent
2a4999b6b8
commit
cf9c1f946a
@ -203,7 +203,6 @@ public class ChunkedWriteHandler
|
|||||||
discard(null);
|
discard(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boolean needsFlush;
|
|
||||||
while (channel.isWritable()) {
|
while (channel.isWritable()) {
|
||||||
if (currentWrite == null) {
|
if (currentWrite == null) {
|
||||||
currentWrite = queue.poll();
|
currentWrite = queue.poll();
|
||||||
@ -212,7 +211,6 @@ public class ChunkedWriteHandler
|
|||||||
if (currentWrite == null) {
|
if (currentWrite == null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
needsFlush = true;
|
|
||||||
final PendingWrite currentWrite = this.currentWrite;
|
final PendingWrite currentWrite = this.currentWrite;
|
||||||
final Object pendingMessage = currentWrite.msg;
|
final Object pendingMessage = currentWrite.msg;
|
||||||
|
|
||||||
@ -307,9 +305,9 @@ public class ChunkedWriteHandler
|
|||||||
this.currentWrite = null;
|
this.currentWrite = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needsFlush) {
|
// Always need to flush
|
||||||
ctx.flush();
|
ctx.flush();
|
||||||
}
|
|
||||||
if (!channel.isActive()) {
|
if (!channel.isActive()) {
|
||||||
discard(new ClosedChannelException());
|
discard(new ClosedChannelException());
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user