Just add a comment to show that the code is related to #597
This commit is contained in:
parent
ded98ddaf9
commit
058dfd0a78
@ -253,6 +253,9 @@ final class NioEventLoop extends SingleThreadEventLoop {
|
|||||||
|
|
||||||
private void processSelectedKeys() {
|
private void processSelectedKeys() {
|
||||||
Set<SelectionKey> selectedKeys = selector.selectedKeys();
|
Set<SelectionKey> selectedKeys = selector.selectedKeys();
|
||||||
|
// check if the set is empty and if so just return to not create garbage by
|
||||||
|
// creating a new Iterator every time even if there is nothing to process.
|
||||||
|
// See https://github.com/netty/netty/issues/597
|
||||||
if (selectedKeys.isEmpty()) {
|
if (selectedKeys.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user