diff --git a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java index 4b52804e9b..037415d5d7 100644 --- a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java +++ b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java @@ -19,6 +19,8 @@ import io.netty.channel.EventLoop; import io.netty.channel.EventLoopGroup; import io.netty.channel.SingleThreadEventLoop; import io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe; +import io.netty.util.collection.IntObjectHashMap; +import io.netty.util.collection.IntObjectMap; import io.netty.util.internal.PlatformDependent; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; @@ -26,8 +28,6 @@ import io.netty.util.internal.logging.InternalLoggerFactory; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; -import java.util.Map; import java.util.Queue; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; @@ -50,7 +50,7 @@ final class EpollEventLoop extends SingleThreadEventLoop { private final int epollFd; private final int eventFd; - private final Map ids = new HashMap(); + private final IntObjectMap ids = new IntObjectHashMap(); private final long[] events; private int id; @@ -292,8 +292,8 @@ final class EpollEventLoop extends SingleThreadEventLoop { Native.epollWait(epollFd, events, 0); Collection channels = new ArrayList(ids.size()); - for (AbstractEpollChannel ch: ids.values()) { - channels.add(ch); + for (IntObjectMap.Entry entry: ids.entries()) { + channels.add(entry.value()); } for (AbstractEpollChannel ch: channels) {