Skip to content

Commit

Permalink
[Truffle] Fix Kernel#hash seed name
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Sep 15, 2016
1 parent 7ddb76a commit ac60bbe
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -895,18 +895,18 @@ private static String gets(BufferedReader reader) throws InterruptedException {
@CoreMethod(names = "hash")
public abstract static class HashNode extends CoreMethodArrayArgumentsNode {

private static final int MURMUR_ARRAY_SEED = System.identityHashCode(HashNode.class);
private static final int MURMUR_SEED = System.identityHashCode(HashNode.class);

@Specialization
public long hash(int value) {
long h = Helpers.hashStart(getContext().getJRubyRuntime(), MURMUR_ARRAY_SEED);
long h = Helpers.hashStart(getContext().getJRubyRuntime(), MURMUR_SEED);
h = Helpers.murmurCombine(h, value);
return Helpers.hashEnd(h);
}

@Specialization
public long hash(long value) {
long h = Helpers.hashStart(getContext().getJRubyRuntime(), MURMUR_ARRAY_SEED);
long h = Helpers.hashStart(getContext().getJRubyRuntime(), MURMUR_SEED);
h = Helpers.murmurCombine(h, value);
return Helpers.hashEnd(h);
}
Expand Down

0 comments on commit ac60bbe

Please sign in to comment.