You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/07/05 07:22:22 UTC

[GitHub] [ignite] alex-plekhanov commented on a diff in pull request #10080: IGNITE-17046 Move H2RowComparator logic to the core module

alex-plekhanov commented on code in PR #10080:
URL: https://github.com/apache/ignite/pull/10080#discussion_r913466968


##########
modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/inline/types/BooleanInlineIndexKeyType.java:
##########
@@ -46,10 +48,15 @@ public BooleanInlineIndexKeyType() {
     }
 
     /** {@inheritDoc} */
-    @Override public int compare0(long pageAddr, int off, BooleanIndexKey key) {
+    @Override public boolean isComparableTo(IndexKey key) {
+        return key instanceof NumericIndexKey;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int compare0(long pageAddr, int off, IndexKey key) {
         boolean bool1 = PageUtils.getByte(pageAddr, off + 1) != 0;
 
-        return Integer.signum(Boolean.compare(bool1, (boolean)key.key()));
+        return -((NumericIndexKey)key).compareTo(bool1);

Review Comment:
   But `ObjectHashInlineIndexKeyType` is not a `NumericIndexKey`. All `NumericIndexKey`'s return -1, 0 or 1, so `Integer.signum()` is not required



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org