We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f4842a commit 5873009Copy full SHA for 5873009
1 file changed
src/main/cljs/cljs/core.cljs
@@ -12552,9 +12552,20 @@ reduces them without incurring seq initialization"
12552
ISeqable
12553
(-seq [coll]
12554
(when (pos? count)
12555
- (let [hashes (.sort (js-keys hashobj))]
12556
- (mapcat #(map (fn [[k v]] (MapEntry. k v nil)) (partition 2 (unchecked-get hashobj %)))
12557
- hashes))))
+ (let [hashes (.sort (js-keys hashobj))
+ cnt (alength hashes)
+ arr (array)]
12558
+ (loop [i 0]
12559
+ (if (< i cnt)
12560
+ (let [bckt (unchecked-get hashobj (aget hashes i))
12561
+ len (alength bkt)]
12562
+ (loop [j 0]
12563
+ (when (< j len)
12564
+ (do
12565
+ (.push arr (MapEntry. (aget bkt j) (aget bkt (inc j)) nil))
12566
+ (recur (+ j 2)))))
12567
+ (recur (inc i)))
12568
+ (prim-seq arr))))))
12569
12570
ICounted
12571
(-count [coll] count)
0 commit comments