Small optimization to save the allocation of an iterator,

in case the selector has been woken up without selected keys.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2018-03-20 10:38:53 +01:00
parent a107bdd2bb
commit adeaf77c02
1 changed files with 1 additions and 1 deletions

View File

@ -397,7 +397,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
}
_keys = selector.selectedKeys();
_cursor = _keys.iterator();
_cursor = _keys.isEmpty() ? Collections.emptyIterator() : _keys.iterator();
if (LOG.isDebugEnabled())
LOG.debug("Selector {} processing {} keys, {} updates", selector, _keys.size(), updates);