mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 12:51:51 +09:00
determining array base offset: replaced trick code with proper code
This commit is contained in:
@@ -17,8 +17,6 @@ public class XXHash32 {
|
||||
static final int PRIME4 = 0x27D4EB2F;
|
||||
static final int PRIME5 = 0x165667B1;
|
||||
|
||||
static final int ARRAY_ELEM_OFFSET = (AppLoader.is32BitJVM) ? 8 : 16;
|
||||
|
||||
public static int hash(byte[] data, int seed) {
|
||||
int end = data.length;
|
||||
int offset = 0;
|
||||
@@ -74,6 +72,6 @@ public class XXHash32 {
|
||||
}
|
||||
|
||||
protected static int getInt(byte[] data, int offset) {
|
||||
return UnsafeHelper.INSTANCE.getUnsafe().getInt(data, offset + ARRAY_ELEM_OFFSET);
|
||||
return UnsafeHelper.INSTANCE.getUnsafe().getInt(data, offset + UnsafeHelper.INSTANCE.getArrayOffset(data));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user