Inlined too trivial write() method

This commit is contained in:
Trustin Lee 2010-01-29 03:09:24 +00:00
parent e0c14e096a
commit 2e363ee918
2 changed files with 2 additions and 11 deletions

View File

@ -349,7 +349,7 @@ class NioDatagramWorker implements Runnable {
}
}
if ((readyOps & SelectionKey.OP_WRITE) != 0) {
write(k);
write((NioDatagramChannel) k.attachment());
}
} catch (CancelledKeyException e) {
close(k);
@ -370,10 +370,6 @@ class NioDatagramWorker implements Runnable {
return false;
}
private void write(SelectionKey k) {
write((NioDatagramChannel) k.attachment());
}
/**
* Read is called when a Selector has been notified that the underlying channel
* was something to be read. The channel would previously have registered its interest

View File

@ -280,7 +280,7 @@ class NioWorker implements Runnable {
}
}
if ((readyOps & SelectionKey.OP_WRITE) != 0) {
write(k);
write((NioSocketChannel) k.attachment());
}
} catch (CancelledKeyException e) {
close(k);
@ -361,11 +361,6 @@ class NioWorker implements Runnable {
return true;
}
private void write(SelectionKey k) {
NioSocketChannel ch = (NioSocketChannel) k.attachment();
write(ch);
}
private void close(SelectionKey k) {
NioSocketChannel ch = (NioSocketChannel) k.attachment();
close(ch, succeededFuture(ch));