commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r1532192 - /commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Date Tue, 15 Oct 2013 05:27:09 GMT
Author: dbrosius
Date: Tue Oct 15 05:27:08 2013
New Revision: 1532192

URL: http://svn.apache.org/r1532192
Log:
avoid unnecessary allocations

Modified:
    commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1532192&r1=1532191&r2=1532192&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
(original)
+++ commons/proper/pool/trunk/src/main/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
Tue Oct 15 05:27:08 2013
@@ -1294,10 +1294,10 @@ public class GenericKeyedObjectPool<K,T>
                 new HashMap<String,List<DefaultPooledObjectInfo>>();
 
         for (K key : poolMap.keySet()) {
-            List<DefaultPooledObjectInfo> list =
-                    new ArrayList<DefaultPooledObjectInfo>();
             ObjectDeque<T> queue = poolMap.get(key);
             if (queue != null) {
+                List<DefaultPooledObjectInfo> list =
+                        new ArrayList<DefaultPooledObjectInfo>();
                 result.put(key.toString(), list);
                 for (PooledObject<T> p : queue.getAllObjects().values()) {
                     list.add(new DefaultPooledObjectInfo(p));



Mime
View raw message