Reuse child NodeIdentifier
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / EffectiveRibInWriter.java
index 85b44407f93aee04d3347ad8f13bcd0759123819..4781768446f24df2fc92a913d58c51c8092a1a16 100644 (file)
@@ -144,14 +144,14 @@ final class EffectiveRibInWriter implements AutoCloseable {
                     break;
                 case SUBTREE_MODIFIED:
                 case WRITE:
-                    tx.put(LogicalDatastoreType.OPERATIONAL, tablePath.node(child.getIdentifier()), child.getDataAfter().get());
+                    final YangInstanceIdentifier childPath = tablePath.node(child.getIdentifier());
+                    tx.put(LogicalDatastoreType.OPERATIONAL, childPath, child.getDataAfter().get());
 
                     // Routes are special, as they may end up being filtered. The previous put conveniently
                     // ensured that we have them in at target, so a subsequent delete will not fail :)
                     if (TABLE_ROUTES.equals(child.getIdentifier())) {
-                        final YangInstanceIdentifier routesPath = tablePath.node(Routes.QNAME);
                         for (final DataTreeCandidateNode route : ribSupport.changedRoutes(child)) {
-                            processRoute(tx, ribSupport, policy, routesPath, route);
+                            processRoute(tx, ribSupport, policy, childPath, route);
                         }
                     }
                     break;