Tiny optimization
This commit is contained in:
parent
73c81acdfa
commit
c59da2dfe6
@ -315,13 +315,11 @@ class NioWorker implements Runnable {
|
|||||||
bufferFactory.getBuffer(predictor.nextReceiveBufferSize());
|
bufferFactory.getBuffer(predictor.nextReceiveBufferSize());
|
||||||
|
|
||||||
final ByteBuffer directBuffer;
|
final ByteBuffer directBuffer;
|
||||||
final boolean fromPool;
|
final boolean fromPool = !buffer.isDirect();
|
||||||
if (buffer.isDirect()) {
|
if (fromPool) {
|
||||||
directBuffer = buffer.toByteBuffer();
|
|
||||||
fromPool = false;
|
|
||||||
} else {
|
|
||||||
directBuffer = directBufferPool.acquire(buffer.writableBytes());
|
directBuffer = directBufferPool.acquire(buffer.writableBytes());
|
||||||
fromPool = true;
|
} else {
|
||||||
|
directBuffer = buffer.toByteBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user