Drop redundant ofPort check 27/30227/1
authorStephen Kitt <skitt@redhat.com>
Thu, 26 Nov 2015 08:43:05 +0000 (09:43 +0100)
committerStephen Kitt <skitt@redhat.com>
Thu, 26 Nov 2015 08:43:05 +0000 (09:43 +0100)
Because of the break in the loop, ofPort is always 0 when the if
statement is reached, so it can safely be removed.

Change-Id: Ia700962e9d5a7d8a4dd0fa1af61811694ac366fe
Signed-off-by: Stephen Kitt <skitt@redhat.com>
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/NetvirtSfcWorkaroundOF13Provider.java

index a474d1709377cdad67f062179bd5857607c705f9..c4d1ad57f84b30fc3904cd4b82d7d8755514c2fe 100644 (file)
@@ -512,14 +512,12 @@ public class NetvirtSfcWorkaroundOF13Provider implements INetvirtSfcOF13Provider
         if (ofPort == 0L) {
             for (int i = 0; i < 5; i++) {
                 LOG.info("Looking for ofPort {}, try: {}", portName, i);
-                if (ofPort == 0L) {
-                    TerminationPoint tp = southbound.readTerminationPoint(bridgeNode, null, portName);
-                    if (tp != null) {
-                        port = tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
-                        if (port != null) {
-                            ofPort = southbound.getOFPort(port);
-                            break;
-                        }
+                TerminationPoint tp = southbound.readTerminationPoint(bridgeNode, null, portName);
+                if (tp != null) {
+                    port = tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
+                    if (port != null) {
+                        ofPort = southbound.getOFPort(port);
+                        break;
                     }
                 }
                 try {