From 1257b6b217ae7fb2fca640b5991eac2a0266a93f Mon Sep 17 00:00:00 2001 From: Alissa Bonas Date: Mon, 16 Dec 2013 17:28:06 +0200 Subject: [PATCH] Simplify method isMutualExclusive in Subnet. Remove redundant 'if' statements. Change-Id: I4ba0b5da22095e5d294eea008119dc49159795af Signed-off-by: Alissa Bonas --- .../controller/switchmanager/Subnet.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Subnet.java b/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Subnet.java index f33fa18e29..0a00cda9af 100644 --- a/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Subnet.java +++ b/opendaylight/switchmanager/api/src/main/java/org/opendaylight/controller/switchmanager/Subnet.java @@ -251,17 +251,7 @@ public class Subnet implements Cloneable, Serializable { } public boolean isMutualExclusive(Subnet otherSubnet) { - if (this.networkAddress.getClass() != otherSubnet.networkAddress - .getClass()) { - return true; - } - if (this.isSubnetOf(otherSubnet.getNetworkAddress())) { - return false; - } - if (otherSubnet.isSubnetOf(this.getNetworkAddress())) { - return false; - } - return true; + return !(isSubnetOf(otherSubnet.getNetworkAddress()) || otherSubnet.isSubnetOf(getNetworkAddress())); } /** -- 2.36.6