Use if-else
This commit is contained in:
parent
7e152d4935
commit
1835a52a8e
|
@ -774,13 +774,11 @@ public abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K,
|
|||
Map.Entry<K, V> e = null;
|
||||
if (fromKey == null) {
|
||||
e = firstEntry();
|
||||
} else {
|
||||
if (fromInclusive) {
|
||||
} else if (fromInclusive) {
|
||||
e = ceilingEntry(fromKey);
|
||||
} else {
|
||||
e = higherEntry(fromKey);
|
||||
}
|
||||
}
|
||||
|
||||
final K first = e != null ? e.getKey() : null;
|
||||
if (e == null || toKey != null && !inToRange(first, false)) {
|
||||
|
@ -814,13 +812,11 @@ public abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K,
|
|||
final Map.Entry<K, V> e;
|
||||
if (toKey == null) {
|
||||
e = lastEntry();
|
||||
} else {
|
||||
if (toInclusive) {
|
||||
} else if (toInclusive) {
|
||||
e = floorEntry(toKey);
|
||||
} else {
|
||||
e = lowerEntry(toKey);
|
||||
}
|
||||
}
|
||||
|
||||
final K last = e != null ? e.getKey() : null;
|
||||
if (e == null || fromKey != null && !inFromRange(last, false)) {
|
||||
|
@ -2314,11 +2310,9 @@ public abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K,
|
|||
if (selectR(h.left, h.bitIndex, key, lengthInBits, reference)) {
|
||||
return selectR(h.right, h.bitIndex, key, lengthInBits, reference);
|
||||
}
|
||||
} else {
|
||||
if (selectR(h.right, h.bitIndex, key, lengthInBits, reference)) {
|
||||
} else if (selectR(h.right, h.bitIndex, key, lengthInBits, reference)) {
|
||||
return selectR(h.left, h.bitIndex, key, lengthInBits, reference);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue