|
1198 | 1198 | (next coll))
|
1199 | 1199 | (mix-collection-hash hash-code n))))
|
1200 | 1200 |
|
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)) |
1208 | 1203 |
|
1209 | 1204 | (defn ^number hash-unordered-coll
|
1210 | 1205 | "Returns the hash code, consistent with =, for an external unordered
|
|
1218 | 1213 | (recur (inc n) (bit-or (+ hash-code (hash (first coll))) 0) (next coll))
|
1219 | 1214 | (mix-collection-hash hash-code n))))
|
1220 | 1215 |
|
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)) |
1228 | 1218 |
|
1229 | 1219 | ;;;;;;;;;;;;;;;;;;; protocols on primitives ;;;;;;;;
|
1230 | 1220 | (declare hash-map list equiv-sequential)
|
@@ -2811,7 +2801,7 @@ reduces them without incurring seq initialization"
|
2811 | 2801 | false))
|
2812 | 2802 |
|
2813 | 2803 | IHash
|
2814 |
| - (-hash [coll] (empty-ordered-hash)) |
| 2804 | + (-hash [coll] empty-ordered-hash) |
2815 | 2805 |
|
2816 | 2806 | ISeqable
|
2817 | 2807 | (-seq [coll] nil)
|
@@ -4926,7 +4916,7 @@ reduces them without incurring seq initialization"
|
4926 | 4916 | (set! (.-EMPTY-NODE PersistentVector) (VectorNode. nil (make-array 32)))
|
4927 | 4917 |
|
4928 | 4918 | (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)) |
4930 | 4920 |
|
4931 | 4921 | (set! (.-fromArray PersistentVector)
|
4932 | 4922 | (fn [xs ^boolean no-clone]
|
@@ -5476,7 +5466,7 @@ reduces them without incurring seq initialization"
|
5476 | 5466 | ICounted
|
5477 | 5467 | (-count [coll] count))
|
5478 | 5468 |
|
5479 |
| -(set! (.-EMPTY PersistentQueue) (PersistentQueue. nil 0 nil [] (empty-ordered-hash))) |
| 5469 | +(set! (.-EMPTY PersistentQueue) (PersistentQueue. nil 0 nil [] empty-ordered-hash)) |
5480 | 5470 |
|
5481 | 5471 | (es6-iterable PersistentQueue)
|
5482 | 5472 |
|
@@ -5653,7 +5643,7 @@ reduces them without incurring seq initialization"
|
5653 | 5643 | (-as-transient [coll]
|
5654 | 5644 | (transient (into (hash-map) coll))))
|
5655 | 5645 |
|
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)) |
5657 | 5647 |
|
5658 | 5648 | (set! (.-HASHMAP_THRESHOLD ObjMap) 8)
|
5659 | 5649 |
|
@@ -6005,7 +5995,7 @@ reduces them without incurring seq initialization"
|
6005 | 5995 | (-as-transient [coll]
|
6006 | 5996 | (TransientArrayMap. (js-obj) (alength arr) (aclone arr))))
|
6007 | 5997 |
|
6008 |
| -(set! (.-EMPTY PersistentArrayMap) (PersistentArrayMap. nil 0 (array) (empty-unordered-hash))) |
| 5998 | +(set! (.-EMPTY PersistentArrayMap) (PersistentArrayMap. nil 0 (array) empty-unordered-hash)) |
6009 | 5999 |
|
6010 | 6000 | (set! (.-HASHMAP-THRESHOLD PersistentArrayMap) 8)
|
6011 | 6001 |
|
@@ -6941,7 +6931,7 @@ reduces them without incurring seq initialization"
|
6941 | 6931 | (-as-transient [coll]
|
6942 | 6932 | (TransientHashMap. (js-obj) root cnt has-nil? nil-val)))
|
6943 | 6933 |
|
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)) |
6945 | 6935 |
|
6946 | 6936 | (set! (.-fromArray PersistentHashMap)
|
6947 | 6937 | (fn [arr ^boolean no-clone]
|
@@ -7734,7 +7724,7 @@ reduces them without incurring seq initialization"
|
7734 | 7724 |
|
7735 | 7725 | (-comparator [coll] comp))
|
7736 | 7726 |
|
7737 |
| -(set! (.-EMPTY PersistentTreeMap) (PersistentTreeMap. compare nil 0 nil (empty-unordered-hash))) |
| 7727 | +(set! (.-EMPTY PersistentTreeMap) (PersistentTreeMap. compare nil 0 nil empty-unordered-hash)) |
7738 | 7728 |
|
7739 | 7729 | (es6-iterable PersistentTreeMap)
|
7740 | 7730 |
|
@@ -8055,7 +8045,7 @@ reduces them without incurring seq initialization"
|
8055 | 8045 | (-as-transient [coll] (TransientHashSet. (-as-transient hash-map))))
|
8056 | 8046 |
|
8057 | 8047 | (set! (.-EMPTY PersistentHashSet)
|
8058 |
| - (PersistentHashSet. nil (.-EMPTY PersistentArrayMap) (empty-unordered-hash))) |
| 8048 | + (PersistentHashSet. nil (.-EMPTY PersistentArrayMap) empty-unordered-hash)) |
8059 | 8049 |
|
8060 | 8050 | (set! (.-fromArray PersistentHashSet)
|
8061 | 8051 | (fn [items ^boolean no-clone]
|
@@ -8201,7 +8191,7 @@ reduces them without incurring seq initialization"
|
8201 | 8191 | (-lookup coll k not-found)))
|
8202 | 8192 |
|
8203 | 8193 | (set! (.-EMPTY PersistentTreeSet)
|
8204 |
| - (PersistentTreeSet. nil (.-EMPTY PersistentTreeMap) (empty-unordered-hash))) |
| 8194 | + (PersistentTreeSet. nil (.-EMPTY PersistentTreeMap) empty-unordered-hash)) |
8205 | 8195 |
|
8206 | 8196 | (es6-iterable PersistentTreeSet)
|
8207 | 8197 |
|
|
0 commit comments