diff --git a/src/main/java/io/airlift/compress/v3/lz4/Lz4RawCompressor.java b/src/main/java/io/airlift/compress/v3/lz4/Lz4RawCompressor.java index 68503f11..2d23738b 100644 --- a/src/main/java/io/airlift/compress/v3/lz4/Lz4RawCompressor.java +++ b/src/main/java/io/airlift/compress/v3/lz4/Lz4RawCompressor.java @@ -104,10 +104,10 @@ public static int compress( // First Byte // put position in hash - table[hash(UNSAFE.getLong(inputBase, input), mask)] = (int) (input - inputAddress); + table[hash(UNSAFE.getInt(inputBase, input), mask)] = (int) (input - inputAddress); input++; - int nextHash = hash(UNSAFE.getLong(inputBase, input), mask); + int nextHash = hash(UNSAFE.getInt(inputBase, input), mask); boolean done = false; do { @@ -130,7 +130,7 @@ public static int compress( // get position on hash matchIndex = inputAddress + table[hash]; - nextHash = hash(UNSAFE.getLong(inputBase, nextInputIndex), mask); + nextHash = hash(UNSAFE.getInt(inputBase, nextInputIndex), mask); // put position on hash table[hash] = (int) (input - inputAddress); @@ -165,16 +165,16 @@ public static int compress( } long position = input - 2; - table[hash(UNSAFE.getLong(inputBase, position), mask)] = (int) (position - inputAddress); + table[hash(UNSAFE.getInt(inputBase, position), mask)] = (int) (position - inputAddress); // Test next position - int hash = hash(UNSAFE.getLong(inputBase, input), mask); + int hash = hash(UNSAFE.getInt(inputBase, input), mask); matchIndex = inputAddress + table[hash]; table[hash] = (int) (input - inputAddress); if (matchIndex + MAX_DISTANCE < input || UNSAFE.getInt(inputBase, matchIndex) != UNSAFE.getInt(inputBase, input)) { input++; - nextHash = hash(UNSAFE.getLong(inputBase, input), mask); + nextHash = hash(UNSAFE.getInt(inputBase, input), mask); break; }