This is an automated email from the ASF dual-hosted git repository.

tv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jcs.git

commit cb6df11821c7fdc9d012103e8d856dd8c67b9b2c
Author: Thomas Vandahl <t...@apache.org>
AuthorDate: Sun Mar 28 18:51:08 2021 +0200

    Simplify
---
 .../commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java      | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 
a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java
 
b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java
index 4259df4..d3ea105 100644
--- 
a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java
+++ 
b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/auxiliary/disk/indexed/IndexedDiskCache.java
@@ -636,8 +636,6 @@ public class IndexedDiskCache<K, V> extends 
AbstractDiskCache<K, V>
      */
     private ICacheElement<K, V> readElement(final K key) throws IOException
     {
-        ICacheElement<K, V> object = null;
-
         final IndexedDiskElementDescriptor ded = keyHash.get(key);
 
         if (ded != null)
@@ -646,8 +644,7 @@ public class IndexedDiskCache<K, V> extends 
AbstractDiskCache<K, V>
 
             try
             {
-                final ICacheElement<K, V> readObject = 
dataFile.readObject(ded);
-                object = readObject;
+                return dataFile.readObject(ded);
                 // TODO consider checking key equality and throwing if there 
is a failure
             }
             catch (final IOException e)
@@ -662,7 +659,7 @@ public class IndexedDiskCache<K, V> extends 
AbstractDiskCache<K, V>
             }
         }
 
-        return object;
+        return null;
     }
 
     /**

Reply via email to