We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 429d7ca commit 5ad974dCopy full SHA for 5ad974d
1 file changed
src/main/cljs/cljs/core.cljs
@@ -12274,6 +12274,15 @@ reduces them without incurring seq initialization"
12274
12275
;;; Vector
12276
12277
+(deftype VectorIterator [arr ^:mutable i]
12278
+ Object
12279
+ (hasNext [_]
12280
+ (< i (alength arr)))
12281
+ (next [_]
12282
+ (let [x (aget arr i)]
12283
+ (set! i (inc i))
12284
+ x)))
12285
+
12286
(deftype Vector [meta array ^:mutable __hash]
12287
Object
12288
(toString [coll]
@@ -12438,6 +12447,10 @@ reduces them without incurring seq initialization"
12438
12447
(-persistent! [coll]
12439
12448
coll)
12440
12449
12450
+ IIterable
12451
+ (-iterator [coll]
12452
+ (VectorIterator. array 0))
12453
12441
12454
IPrintWithWriter
12442
12455
(-pr-writer [coll writer opts] (pr-sequential-writer writer pr-writer "[" " " "]" opts coll)))
12443
12456
0 commit comments