You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/04 02:59:17 UTC

[GitHub] [arrow] jacques-n commented on a change in pull request #7101: ARROW-8695: [Java] Remove references to PlatformDependent in arrow-memory

jacques-n commented on a change in pull request #7101:
URL: https://github.com/apache/arrow/pull/7101#discussion_r434964912



##########
File path: java/memory/src/main/java/org/apache/arrow/memory/util/hash/SimpleHasher.java
##########
@@ -58,21 +56,21 @@ public int hashCode(long address, long length) {
     int hashValue = 0;
     int index = 0;
     while (index + 8 <= length) {
-      long longValue = getLong(address + index);
+      long longValue = MemoryUtil.UNSAFE.getLong(address + index);
       int longHash = getLongHashCode(longValue);
       hashValue = combineHashCode(hashValue, longHash);
       index += 8;
     }
 
     if (index + 4 <= length) {
-      int intValue = getInt(address + index);
+      int intValue = MemoryUtil.UNSAFE.getInt(address + index);
       int intHash = intValue;
       hashValue = combineHashCode(hashValue, intHash);
       index += 4;
     }
 
     while (index < length) {
-      byte byteValue = getByte(address + index);
+      byte byteValue = MemoryUtil.UNSAFE.getByte(address + index);

Review comment:
       no, looks good.




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

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