cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1071645 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ExpiringMap.java
Date Thu, 17 Feb 2011 15:30:08 GMT
Author: jbellis
Date: Thu Feb 17 15:30:08 2011
New Revision: 1071645

URL: http://svn.apache.org/viewvc?rev=1071645&view=rev
Log:
ExpiringMap cleanup
patch by Pavel Yaskevich

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ExpiringMap.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ExpiringMap.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ExpiringMap.java?rev=1071645&r1=1071644&r2=1071645&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ExpiringMap.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/utils/ExpiringMap.java
Thu Feb 17 15:30:08 2011
@@ -117,35 +117,20 @@ public class ExpiringMap<K, V>
 
     public V get(K key)
     {
-        V result = null;
         CacheableObject<V> co = cache.get(key);
-        if (co != null)
-        {
-            result = co.getValue();
-        }
-        return result;
+        return co == null ? null : co.getValue();
     }
 
     public V remove(K key)
     {
         CacheableObject<V> co = cache.remove(key);
-        V result = null;
-        if (co != null)
-        {
-            result = co.getValue();
-        }
-        return result;
+        return co == null ? null : co.getValue();
     }
 
     public long getAge(K key)
     {
-        long age = 0;
         CacheableObject<V> co = cache.get(key);
-        if (co != null)
-        {
-            age = co.age;
-        }
-        return age;
+        return co == null ? 0 : co.age;
     }
 
     public int size()



Mime
View raw message