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 027aec23b8
commit f44e424655

View File

@ -484,7 +484,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);
}
}