Remove duplicated calculation (#9565)

Motivation:

calculateMaxBytesPerGatheringWrite() contains duplicated calculation:  getSendBufferSize() << 1

Modifications:

Remove the duplicated calculation

Result:

The method will be clear and better
This commit is contained in:
stroller 2019-09-15 14:05:21 +08:00 committed by Norman Maurer
parent 21720e4a78
commit d01282e5f9

View File

@ -517,7 +517,7 @@ public class NioSocketChannel extends AbstractNioByteChannel implements io.netty
// Multiply by 2 to give some extra space in case the OS can process write data faster than we can provide.
int newSendBufferSize = getSendBufferSize() << 1;
if (newSendBufferSize > 0) {
setMaxBytesPerGatheringWrite(getSendBufferSize() << 1);
setMaxBytesPerGatheringWrite(newSendBufferSize);
}
}