From e6dbef812c22ca55133d88c0f07f0e440bf325a3 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Wed, 27 Jun 2018 17:10:08 +0200 Subject: srv6: simplify if condition in SidCustomizer.extractLocPrefix Do not check loc.getPrefix() == null twice. Change-Id: I04a9dae25e14761d7f287aedd636dda8169f2dc9 Signed-off-by: Marek Gradzki --- .../src/main/java/io/fd/hc2vpp/srv6/write/sid/SidCustomizer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/srv6/srv6-impl/src/main/java/io/fd/hc2vpp/srv6/write/sid/SidCustomizer.java b/srv6/srv6-impl/src/main/java/io/fd/hc2vpp/srv6/write/sid/SidCustomizer.java index 1b3e569c7..827dd3f5c 100644 --- a/srv6/srv6-impl/src/main/java/io/fd/hc2vpp/srv6/write/sid/SidCustomizer.java +++ b/srv6/srv6-impl/src/main/java/io/fd/hc2vpp/srv6/write/sid/SidCustomizer.java @@ -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)); } -- cgit 1.2.3-korg