Skip to content

Commit 09faa72

Browse files
belugabehrnormanmaurer
authored andcommitted
Use ArrayDeque instead of LinkedList (netty#9046)
Motivation: Prefer ArrayDeque to LinkedList because latter will produce more GC. Modification: - Replace LinkedList with ArrayDeque Result: Less GC
1 parent dde3f56 commit 09faa72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpResponseStreamIdHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import io.netty.handler.codec.spdy.SpdyHttpHeaders.Names;
2222
import io.netty.util.ReferenceCountUtil;
2323

24-
import java.util.LinkedList;
24+
import java.util.ArrayDeque;
2525
import java.util.List;
2626
import java.util.Queue;
2727

@@ -33,7 +33,7 @@
3333
public class SpdyHttpResponseStreamIdHandler extends
3434
MessageToMessageCodec<Object, HttpMessage> {
3535
private static final Integer NO_ID = -1;
36-
private final Queue<Integer> ids = new LinkedList<Integer>();
36+
private final Queue<Integer> ids = new ArrayDeque<Integer>();
3737

3838
@Override
3939
public boolean acceptInboundMessage(Object msg) throws Exception {

0 commit comments

Comments
 (0)