diff --git a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/MiscPrimitivePlugin.java b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/MiscPrimitivePlugin.java index 5bc8dbe98..e43a15c89 100644 --- a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/MiscPrimitivePlugin.java +++ b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/MiscPrimitivePlugin.java @@ -416,7 +416,8 @@ protected static final long doNativeObject(@SuppressWarnings("unused") final Obj private abstract static class AbstractPrimStringHashNode extends AbstractPrimitiveNode { protected static final long calculateHash(final long initialHash, final byte[] bytes) { - long hash = initialHash & PrimHashMultiplyNode.HASH_MULTIPLY_MASK; + // Using int here is sufficient and slightly more efficient + int hash = (int) initialHash & PrimHashMultiplyNode.HASH_MULTIPLY_MASK; final int length = bytes.length; for (int i = 0; i < length; i++) { hash = (hash + (UnsafeUtils.getByte(bytes, i) & 0xff)) * PrimHashMultiplyNode.HASH_MULTIPLY_CONSTANT & PrimHashMultiplyNode.HASH_MULTIPLY_MASK;