diff --git a/src/main/java/com/linecorp/armeria/client/HttpSessionHandler.java b/src/main/java/com/linecorp/armeria/client/HttpSessionHandler.java index 87cffdcd5dd..3e9e5fca3e4 100644 --- a/src/main/java/com/linecorp/armeria/client/HttpSessionHandler.java +++ b/src/main/java/com/linecorp/armeria/client/HttpSessionHandler.java @@ -17,8 +17,8 @@ import static java.util.Objects.requireNonNull; +import java.util.ArrayDeque; import java.util.Collection; -import java.util.LinkedList; import java.util.Queue; import com.linecorp.armeria.common.SerializationFormat; @@ -180,7 +180,7 @@ private static class SequentialWaitsHolder implements WaitsHolder { private final Queue> requestExpectQueue; SequentialWaitsHolder() { - requestExpectQueue = new LinkedList<>(); + requestExpectQueue = new ArrayDeque<>(); } @Override @@ -216,7 +216,7 @@ private static class MultiplexWaitsHolder implements WaitsHolder { @Override public Promise poll(FullHttpResponse response) { int streamID = response.headers().getInt(ExtensionHeaderNames.STREAM_ID.text(), 0); - return resultExpectMap.get(streamID); + return resultExpectMap.remove(streamID); } @Override