You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2010/04/01 06:34:18 UTC

svn commit: r929818 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java

Author: doogie
Date: Thu Apr  1 04:34:17 2010
New Revision: 929818

URL: http://svn.apache.org/viewvc?rev=929818&view=rev
Log:
In setLru, it's not nescessary to check memoryTable against null.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java?rev=929818&r1=929817&r2=929818&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/cache/CacheLineTable.java Thu Apr  1 04:34:17 2010
@@ -285,12 +285,8 @@ public class CacheLineTable<K, V> implem
     public synchronized void setLru(int newSize) {
         this.maxInMemory = newSize;
 
-        Map<Object, CacheLine<V>> oldmap = null;
-        if (this.memoryTable != null) {
-            // using linked map to preserve the order when using LRU (FastMap is a linked map)
-            oldmap = FastMap.newInstance();
-            oldmap.putAll(this.memoryTable);
-        }
+        // using linked map to preserve the order when using LRU (FastMap is a linked map)
+        Map<Object, CacheLine<V>> oldmap = this.memoryTable;
 
         if (newSize > 0) {
             this.memoryTable = Collections.synchronizedMap(new LRUMap<Object, CacheLine<V>>(newSize));