Do not instantiate entrySet when not needed 85/76985/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 15 Oct 2018 09:00:12 +0000 (11:00 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 15 Oct 2018 09:00:12 +0000 (11:00 +0200)
reloadAllAugmentations() does not need the key, hence we do not
need to instantiate entrySet(), values() is sufficient.

Change-Id: Ib58b5fac547370709ab916ca5f700bc4b841efb8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/DataObjectCodecContext.java

index 74b77e67e7c3c4d9adf66795c4423551d54fa2df..bef0671c68dacc1b6326f0ac66823e2fddbb6b8d 100644 (file)
@@ -133,8 +133,8 @@ abstract class DataObjectCodecContext<D extends DataObject, T extends DataNodeCo
 
     @SuppressFBWarnings("RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED")
     private void reloadAllAugmentations() {
-        for (final Entry<AugmentationIdentifier, Type> augment : possibleAugmentations.entrySet()) {
-            final DataContainerCodecPrototype<?> augProto = getAugmentationPrototype(augment.getValue());
+        for (final Type augment : possibleAugmentations.values()) {
+            final DataContainerCodecPrototype<?> augProto = getAugmentationPrototype(augment);
             if (augProto != null) {
                 byYangAugmented.putIfAbsent(augProto.getYangArg(), augProto);
                 byStreamAugmented.putIfAbsent(augProto.getBindingClass(), augProto);