Skip to content

Commit 22b0c0a

Browse files
puredangerstuarthalloway
authored andcommitted
CLJ-1344 - update mapHasheq function to call Murmur3. This is used by defrecord and some external collections
Signed-off-by: Stuart Halloway <[email protected]>
1 parent 6aaaa0a commit 22b0c0a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/jvm/clojure/lang/APersistentMap.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,15 @@ public int hasheq(){
121121
}
122122

123123
static public int mapHasheq(IPersistentMap m) {
124-
int hash = 0;
125-
for(ISeq s = m.seq(); s != null; s = s.next())
126-
{
127-
Map.Entry e = (Map.Entry) s.first();
128-
hash += Util.hasheq(e.getKey()) ^
129-
Util.hasheq(e.getValue());
130-
}
131-
return hash;
124+
return Murmur3.hashUnordered(m);
125+
// int hash = 0;
126+
// for(ISeq s = m.seq(); s != null; s = s.next())
127+
// {
128+
// Map.Entry e = (Map.Entry) s.first();
129+
// hash += Util.hasheq(e.getKey()) ^
130+
// Util.hasheq(e.getValue());
131+
// }
132+
// return hash;
132133
}
133134

134135
static public class KeySeq extends ASeq{

0 commit comments

Comments
 (0)