Simplify code using Java 8 features
[netconf.git] / restconf / restconf-common / src / main / java / org / opendaylight / restconf / common / util / MultivaluedHashMap.java
index 1036757f498ef4957da1daf40ca19522914f1f7c..4eedb93245726b268e183bb1d26eee4962ed75bb 100644 (file)
@@ -177,12 +177,6 @@ public class MultivaluedHashMap<K, V> implements MultivaluedMap<K, V> {
     }
 
     private List<V> getValues(K key) {
-        List<V> list = store.get(key);
-        if (list == null) {
-            list = new LinkedList<>();
-            store.put(key, list);
-        }
-
-        return list;
+        return store.computeIfAbsent(key, k -> new LinkedList<>());
     }
 }