Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.apache.arrow.memory.util;

import java.nio.ByteOrder;

import org.apache.arrow.memory.util.hash.ArrowBufHasher;
import org.apache.arrow.memory.util.hash.SimpleHasher;
import org.apache.arrow.util.Preconditions;
Expand All @@ -31,8 +29,6 @@
*/
public final class ArrowBufPointer {

public static final boolean LITTLE_ENDIAN = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN;

/**
* The hash code when the arrow buffer is null.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import static io.netty.util.internal.PlatformDependent.getByte;
import static io.netty.util.internal.PlatformDependent.getInt;

import org.apache.arrow.memory.util.ArrowBufPointer;

import io.netty.buffer.ArrowBuf;

/**
Expand Down Expand Up @@ -93,9 +91,6 @@ public static int hashCode(long address, int length, int seed) {
int hash = seed;
while (index + 4 <= length) {
int intValue = getInt(address + index);
if (!ArrowBufPointer.LITTLE_ENDIAN) {
intValue = Integer.reverseBytes(intValue);
}
hash = combineHashCode(hash, intValue);
index += 4;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static io.netty.util.internal.PlatformDependent.getInt;
import static io.netty.util.internal.PlatformDependent.getLong;

import org.apache.arrow.memory.util.ArrowBufPointer;

import io.netty.buffer.ArrowBuf;

/**
Expand Down Expand Up @@ -61,20 +59,13 @@ public int hashCode(long address, int length) {
int index = 0;
while (index + 8 <= length) {
long longValue = getLong(address + index);
if (!ArrowBufPointer.LITTLE_ENDIAN) {
// assume the buffer is in little endian
longValue = Long.reverseBytes(longValue);
}
int longHash = getLongHashCode(longValue);
hashValue = combineHashCode(hashValue, longHash);
index += 8;
}

while (index + 4 <= length) {
int intValue = getInt(address + index);
if (!ArrowBufPointer.LITTLE_ENDIAN) {
intValue = Integer.reverseBytes(intValue);
}
int intHash = intValue;
hashValue = combineHashCode(hashValue, intHash);
index += 4;
Expand Down