From 5fb8e8069b54fb214a8132c9e990662733209de3 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Mon, 15 Jun 2009 07:06:53 +0000 Subject: [PATCH] Tiny optimization that makes header addition faster in most cases --- .../org/jboss/netty/handler/codec/http/DefaultHttpMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/netty/handler/codec/http/DefaultHttpMessage.java b/src/main/java/org/jboss/netty/handler/codec/http/DefaultHttpMessage.java index 719d317a5d..a23ce7d480 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/DefaultHttpMessage.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/DefaultHttpMessage.java @@ -60,7 +60,7 @@ public class DefaultHttpMessage implements HttpMessage { throw new NullPointerException("value is null"); } if (headers.get(name) == null) { - headers.put(name, new ArrayList()); + headers.put(name, new ArrayList(1)); } headers.get(name).add(value); }