summaryrefslogtreecommitdiffstats
path: root/srv6
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-06-27 17:10:08 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-06-28 06:54:27 +0000
commite6dbef812c22ca55133d88c0f07f0e440bf325a3 (patch)
tree62f45d168d8f0c5a9eac3854484b95ec5be80012 /srv6
parentbe5d619ab10035a01f6bbcf44de8381dfd023015 (diff)
srv6: simplify if condition in SidCustomizer.extractLocPrefix
Do not check loc.getPrefix() == null twice. Change-Id: I04a9dae25e14761d7f287aedd636dda8169f2dc9 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'srv6')
-rw-r--r--srv6/srv6-impl/src/main/java/io/fd/hc2vpp/srv6/write/sid/SidCustomizer.java3
1 files changed, 1 insertions, 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));
}