You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ptupitsyn (via GitHub)" <gi...@apache.org> on 2023/07/13 10:26:48 UTC

[GitHub] [ignite-3] ptupitsyn commented on a diff in pull request #2282: IGNITE-17298 Sql. Support BOOLEAN type.

ptupitsyn commented on code in PR #2282:
URL: https://github.com/apache/ignite-3/pull/2282#discussion_r1262358249


##########
modules/core/src/main/java/org/apache/ignite/internal/util/HashCalculator.java:
##########
@@ -94,6 +96,15 @@ public void appendNull() {
         appendByte((byte) 0);
     }
 
+    /**
+     * Append boolean to hash calculation.
+     *
+     * @param v Value to update hash.
+     */
+    public void appendBoolean(boolean v) {
+        hash = HashUtils.hash32(ByteUtils.booleanToByte(v), hash);
+    }

Review Comment:
   Please note the pattern with other existing methods. We should have something like this:
   
   ```java
       public static int hashBoolean(boolean v) {
           return HashUtils.hash32(ByteUtils.booleanToByte(v));
       }
   
       public void appendBoolean(boolean v) {
           hash = combine(hash, hashBoolean(v));
       }
   ```



-- 
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