Tiny optimization

This commit is contained in:
Trustin Lee 2010-01-28 03:31:57 +00:00
parent 73c81acdfa
commit c59da2dfe6

View File

@ -315,13 +315,11 @@ class NioWorker implements Runnable {
bufferFactory.getBuffer(predictor.nextReceiveBufferSize());
final ByteBuffer directBuffer;
final boolean fromPool;
if (buffer.isDirect()) {
directBuffer = buffer.toByteBuffer();
fromPool = false;
} else {
final boolean fromPool = !buffer.isDirect();
if (fromPool) {
directBuffer = directBufferPool.acquire(buffer.writableBytes());
fromPool = true;
} else {
directBuffer = buffer.toByteBuffer();
}
int ret = 0;