Skip to content

Commit d2d0316

Browse files
committed
revert murmur3 hashing changes, created new DCE issues
1 parent 1346c3f commit d2d0316

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,13 +1198,8 @@
11981198
(next coll))
11991199
(mix-collection-hash hash-code n))))
12001200

1201-
(def ^{:private true :jsdoc ["@type {*}"]}
1202-
EMPTY_ORDERED_HASH nil)
1203-
1204-
(defn- empty-ordered-hash []
1205-
(when (nil? EMPTY_ORDERED_HASH)
1206-
(set! EMPTY_ORDERED_HASH (mix-collection-hash 1 0)))
1207-
EMPTY_ORDERED_HASH)
1201+
(def ^:private empty-ordered-hash
1202+
(mix-collection-hash 1 0))
12081203

12091204
(defn ^number hash-unordered-coll
12101205
"Returns the hash code, consistent with =, for an external unordered
@@ -1218,13 +1213,8 @@
12181213
(recur (inc n) (bit-or (+ hash-code (hash (first coll))) 0) (next coll))
12191214
(mix-collection-hash hash-code n))))
12201215

1221-
(def ^{:private true :jsdoc ["@type {*}"]}
1222-
EMPTY_UNORDERED_HASH nil)
1223-
1224-
(defn- empty-unordered-hash []
1225-
(when (nil? EMPTY_UNORDERED_HASH)
1226-
(set! EMPTY_UNORDERED_HASH (mix-collection-hash 0 0)))
1227-
EMPTY_UNORDERED_HASH)
1216+
(def ^:private empty-unordered-hash
1217+
(mix-collection-hash 0 0))
12281218

12291219
;;;;;;;;;;;;;;;;;;; protocols on primitives ;;;;;;;;
12301220
(declare hash-map list equiv-sequential)
@@ -2811,7 +2801,7 @@ reduces them without incurring seq initialization"
28112801
false))
28122802

28132803
IHash
2814-
(-hash [coll] (empty-ordered-hash))
2804+
(-hash [coll] empty-ordered-hash)
28152805

28162806
ISeqable
28172807
(-seq [coll] nil)
@@ -4926,7 +4916,7 @@ reduces them without incurring seq initialization"
49264916
(set! (.-EMPTY-NODE PersistentVector) (VectorNode. nil (make-array 32)))
49274917

49284918
(set! (.-EMPTY PersistentVector)
4929-
(PersistentVector. nil 0 5 (.-EMPTY-NODE PersistentVector) (array) (empty-ordered-hash)))
4919+
(PersistentVector. nil 0 5 (.-EMPTY-NODE PersistentVector) (array) empty-ordered-hash))
49304920

49314921
(set! (.-fromArray PersistentVector)
49324922
(fn [xs ^boolean no-clone]
@@ -5476,7 +5466,7 @@ reduces them without incurring seq initialization"
54765466
ICounted
54775467
(-count [coll] count))
54785468

5479-
(set! (.-EMPTY PersistentQueue) (PersistentQueue. nil 0 nil [] (empty-ordered-hash)))
5469+
(set! (.-EMPTY PersistentQueue) (PersistentQueue. nil 0 nil [] empty-ordered-hash))
54805470

54815471
(es6-iterable PersistentQueue)
54825472

@@ -5653,7 +5643,7 @@ reduces them without incurring seq initialization"
56535643
(-as-transient [coll]
56545644
(transient (into (hash-map) coll))))
56555645

5656-
(set! (.-EMPTY ObjMap) (ObjMap. nil (array) (js-obj) 0 (empty-unordered-hash)))
5646+
(set! (.-EMPTY ObjMap) (ObjMap. nil (array) (js-obj) 0 empty-unordered-hash))
56575647

56585648
(set! (.-HASHMAP_THRESHOLD ObjMap) 8)
56595649

@@ -6005,7 +5995,7 @@ reduces them without incurring seq initialization"
60055995
(-as-transient [coll]
60065996
(TransientArrayMap. (js-obj) (alength arr) (aclone arr))))
60075997

6008-
(set! (.-EMPTY PersistentArrayMap) (PersistentArrayMap. nil 0 (array) (empty-unordered-hash)))
5998+
(set! (.-EMPTY PersistentArrayMap) (PersistentArrayMap. nil 0 (array) empty-unordered-hash))
60095999

60106000
(set! (.-HASHMAP-THRESHOLD PersistentArrayMap) 8)
60116001

@@ -6941,7 +6931,7 @@ reduces them without incurring seq initialization"
69416931
(-as-transient [coll]
69426932
(TransientHashMap. (js-obj) root cnt has-nil? nil-val)))
69436933

6944-
(set! (.-EMPTY PersistentHashMap) (PersistentHashMap. nil 0 nil false nil (empty-unordered-hash)))
6934+
(set! (.-EMPTY PersistentHashMap) (PersistentHashMap. nil 0 nil false nil empty-unordered-hash))
69456935

69466936
(set! (.-fromArray PersistentHashMap)
69476937
(fn [arr ^boolean no-clone]
@@ -7734,7 +7724,7 @@ reduces them without incurring seq initialization"
77347724

77357725
(-comparator [coll] comp))
77367726

7737-
(set! (.-EMPTY PersistentTreeMap) (PersistentTreeMap. compare nil 0 nil (empty-unordered-hash)))
7727+
(set! (.-EMPTY PersistentTreeMap) (PersistentTreeMap. compare nil 0 nil empty-unordered-hash))
77387728

77397729
(es6-iterable PersistentTreeMap)
77407730

@@ -8055,7 +8045,7 @@ reduces them without incurring seq initialization"
80558045
(-as-transient [coll] (TransientHashSet. (-as-transient hash-map))))
80568046

80578047
(set! (.-EMPTY PersistentHashSet)
8058-
(PersistentHashSet. nil (.-EMPTY PersistentArrayMap) (empty-unordered-hash)))
8048+
(PersistentHashSet. nil (.-EMPTY PersistentArrayMap) empty-unordered-hash))
80598049

80608050
(set! (.-fromArray PersistentHashSet)
80618051
(fn [items ^boolean no-clone]
@@ -8201,7 +8191,7 @@ reduces them without incurring seq initialization"
82018191
(-lookup coll k not-found)))
82028192

82038193
(set! (.-EMPTY PersistentTreeSet)
8204-
(PersistentTreeSet. nil (.-EMPTY PersistentTreeMap) (empty-unordered-hash)))
8194+
(PersistentTreeSet. nil (.-EMPTY PersistentTreeMap) empty-unordered-hash))
82058195

82068196
(es6-iterable PersistentTreeSet)
82078197

0 commit comments

Comments
 (0)