We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 650fe98 commit 813e65aCopy full SHA for 813e65a
src/main/cljs/cljs/core.cljs
@@ -12345,6 +12345,23 @@ reduces them without incurring seq initialization"
12345
(-reduce [v f start]
12346
(array-reduce array f start))
12347
12348
+ IKVReduce
12349
+ (-kv-reduce [v f init]
12350
+ (let [len (alength array)]
12351
+ (loop [i 0 init init]
12352
+ (if (< i len)
12353
+ (let [init (f init i (aget array i))]
12354
+ (if (reduced? init)
12355
+ @init
12356
+ (recur (inc i) init)))
12357
+ init))))
12358
+
12359
+ IComparable
12360
+ (-compare [x y]
12361
+ (if (vector? y)
12362
+ (compare-indexed x y)
12363
+ (throw (js/Error. "Cannot compare with Vector"))))
12364
12365
IFn
12366
(-invoke [coll k]
12367
(-lookup coll k))
0 commit comments