Use Data.equivalent() method in KeySearch.keyEquals() (because it could be specialized to perform more efficiently), and switch arguments in Data.bytesEquivalent() usages, so that the first Data instance is more likely to optimized for comparison

This commit is contained in:
leventov
2016-03-04 21:20:12 +07:00
parent 08e21547a8
commit e677f07d46
3 changed files with 4 additions and 6 deletions
@@ -84,9 +84,7 @@ public abstract class KeySearch<K> {
}
boolean keyEquals(long keySize, long keyOffset) {
return inputKey.size() == keySize &&
BytesUtil.bytesEqual(s.segmentBS, keyOffset,
inputKey.bytes(), inputKey.offset(), keySize);
return inputKey.size() == keySize && inputKey.equivalent(s.segmentBS, keyOffset);
}
public boolean searchStatePresent() {