in orderbook-core/src/main/java/com/epam/deltix/orderbook/core/impl/collections/rbt/RBTree.java [268:289]
final Entry<K, V> getEntry(final Object key) {
// Offload comparator-based version for the sake of performance
if (comparator != null) {
return getEntryUsingComparator(key);
}
if (key == null) {
throw new NullPointerException();
}
@SuppressWarnings("unchecked") final Comparable<? super K> k = (Comparable<? super K>) key;
Entry<K, V> p = root;
while (p != null) {
final int cmp = k.compareTo(p.key);
if (cmp < 0) {
p = p.left;
} else if (cmp > 0) {
p = p.right;
} else {
return p;
}
}
return null;
}