Skip to content

Commit 15779cf

Browse files
committed
CLJS-1977: defrecord should use murmur hashing like Clojure
1 parent 138bc63 commit 15779cf

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/main/clojure/cljs/core.cljc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,13 @@
17461746
'ICloneable
17471747
`(~'-clone [this#] (new ~tagname ~@fields))
17481748
'IHash
1749-
`(~'-hash [this#] (caching-hash this# ~'hash-imap ~'__hash))
1749+
`(~'-hash [this#]
1750+
(caching-hash this#
1751+
(fn [coll#]
1752+
(bit-xor
1753+
~(hash (core/-> rname comp/munge core/str))
1754+
(hash-unordered-coll coll#)))
1755+
~'__hash))
17501756
'IEquiv
17511757
(core/let [this (gensym 'this) other (gensym 'other)]
17521758
`(~'-equiv [~this ~other]

0 commit comments

Comments
 (0)