From 7903697c36bbd79e729695e3ca35e24f7674a5bb Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 23 Jul 2013 15:09:14 +0900 Subject: [PATCH] Remove Arrays.fill(..., null) .. because we can just set each element to null while looping --- .../main/java/io/netty/channel/ChannelOutboundBuffer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java b/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java index bdec172a9e..fcfe6b2522 100644 --- a/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java +++ b/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java @@ -30,7 +30,6 @@ import io.netty.util.internal.logging.InternalLoggerFactory; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; -import java.util.Arrays; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; /** @@ -208,7 +207,9 @@ public final class ChannelOutboundBuffer { for (int i = 0; i < unflushedCount; i ++) { flushed[tail] = unflushed[i]; + unflushed[i] = null; flushedPromises[tail] = unflushedPromises[i]; + unflushedPromises[i] = null; flushedPendingSizes[tail] = unflushedPendingSizes[i]; flushedProgresses[tail] = 0; flushedTotals[tail] = unflushedTotals[i]; @@ -225,8 +226,6 @@ public final class ChannelOutboundBuffer { } } - Arrays.fill(unflushed, 0, unflushedCount, null); - Arrays.fill(unflushedPromises, 0, unflushedCount, null); this.unflushedCount = 0; this.tail = tail;