Remove an unnecessary expression in NioEventLoop (#9729)

Motivation:

Remove an unnecessary expression to make the code more readable

Modification:

Remove `eventLoop == null`

Result:

Fixes #9725
This commit is contained in:
SimpleYoung 2019-10-30 19:24:03 +08:00 committed by Norman Maurer
parent 8d99aa1235
commit 82376fd889

View File

@ -666,11 +666,10 @@ public final class NioEventLoop extends SingleThreadEventLoop {
// and thus the SelectionKey could be cancelled as part of the deregistration process, but the channel is // and thus the SelectionKey could be cancelled as part of the deregistration process, but the channel is
// still healthy and should not be closed. // still healthy and should not be closed.
// See https://github.com/netty/netty/issues/5125 // See https://github.com/netty/netty/issues/5125
if (eventLoop != this || eventLoop == null) { if (eventLoop == this) {
return; // close the channel if the key is not valid anymore
unsafe.close(unsafe.voidPromise());
} }
// close the channel if the key is not valid anymore
unsafe.close(unsafe.voidPromise());
return; return;
} }