[ASTERIXDB-3161][STO] Avoid comparing lengths' bytes for strings
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
Avoid comparing the lengths' bytes when
UTF8StringPointable#compare(IValueReference, IValueReference)
is called
Change-Id: If7db4b3a09a3abbf3cd946e91e1971d7957d99ef
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17484
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringPointable.java b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringPointable.java
index 8013e05..f54741d 100644
--- a/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringPointable.java
+++ b/hyracks-fullstack/hyracks/hyracks-data/hyracks-data-std/src/main/java/org/apache/hyracks/data/std/primitive/UTF8StringPointable.java
@@ -219,8 +219,8 @@
}
public static int compare(IValueReference valueA, IValueReference valueB) {
- return UTF8StringUtil.compareTo(valueA.getByteArray(), valueA.getStartOffset(), valueA.getLength(),
- valueB.getByteArray(), valueB.getStartOffset(), valueB.getLength());
+ return UTF8StringUtil.compareTo(valueA.getByteArray(), valueA.getStartOffset(), valueB.getByteArray(),
+ valueB.getStartOffset());
}
/**