CID-1254833 refactor condition to include null-case

This commit is contained in:
Daan Hoogland 2014-11-18 12:12:00 +01:00
parent 31876fb588
commit 638da54fce

View File

@ -1317,11 +1317,8 @@ public class NetUtils {
BigInteger startInt = convertIPv6AddressToBigInteger(start);
BigInteger endInt = convertIPv6AddressToBigInteger(end);
if (endInt != null) {
if (startInt != null)
{
if(startInt.compareTo(endInt) > 0) {
return null;
}
if (startInt == null || startInt.compareTo(endInt) > 0) {
return null;
}
return endInt.subtract(startInt).add(BigInteger.ONE);
}