commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1635475 - /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java
Date Thu, 30 Oct 2014 12:23:10 GMT
Author: ggregory
Date: Thu Oct 30 12:23:10 2014
New Revision: 1635475

URL: http://svn.apache.org/r1635475
Log:
Statement unnecessarily nested within else clause.

Modified:
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java?rev=1635475&r1=1635474&r2=1635475&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/ListOrderedMap.java
Thu Oct 30 12:23:10 2014
@@ -219,12 +219,11 @@ public class ListOrderedMap<K, V>
         if (decorated().containsKey(key)) {
             // re-adding doesn't change order
             return decorated().put(key, value);
-        } else {
-            // first add, so add to both map and list
-            final V result = decorated().put(key, value);
-            insertOrder.add(key);
-            return result;
         }
+        // first add, so add to both map and list
+        final V result = decorated().put(key, value);
+        insertOrder.add(key);
+        return result;
     }
 
     @Override
@@ -460,11 +459,10 @@ public class ListOrderedMap<K, V>
             insertOrder.add(index, key);
             m.put(key, value);
             return result;
-        } else {
-            insertOrder.add(index, key);
-            m.put(key, value);
-            return null;
         }
+        insertOrder.add(index, key);
+        m.put(key, value);
+        return null;
     }
 
     /**



Mime
View raw message