srv6: simplify if condition in SidCustomizer.extractLocPrefix 48/13248/2
authorMarek Gradzki <[email protected]>
Wed, 27 Jun 2018 15:10:08 +0000 (17:10 +0200)
committerMarek Gradzki <[email protected]>
Thu, 28 Jun 2018 06:54:27 +0000 (06:54 +0000)
Do not check loc.getPrefix() == null twice.

Change-Id: I04a9dae25e14761d7f287aedd636dda8169f2dc9
Signed-off-by: Marek Gradzki <[email protected]>
srv6/srv6-impl/src/main/java/io/fd/hc2vpp/srv6/write/sid/SidCustomizer.java

index 1b3e569..827dd3f 100644 (file)
@@ -96,8 +96,7 @@ public class SidCustomizer extends FutureJVppCustomizer implements ListWriterCus
         Preconditions.checkArgument(locatorOpt.isPresent(), "Cannot read locator for sid: {}, with IId: ", localSid,
                 instanceIdentifier);
         Locator loc = locatorOpt.get();
-        if (loc.getPrefix() == null || loc.getPrefix() == null || loc.getPrefix().getAddress() == null ||
-                loc.getPrefix().getLength() == null) {
+        if (loc.getPrefix() == null || loc.getPrefix().getAddress() == null || loc.getPrefix().getLength() == null) {
             throw new WriteFailedException(instanceIdentifier,
                     String.format("Cannot parse locator prefix for local sid %s", localSid));
         }