Skip to content

Commit

Permalink
chunked-seq? for now checks for concrete types ChunkedCons and
Browse files Browse the repository at this point in the history
`ChunkedSeq`. this is an optimization for `doseq` and `for`. calling
`satisfies?` to check for chunked seqs is slow for the failing case -
normal seqs.
  • Loading branch information
swannodette committed Apr 26, 2013
1 parent 44389e2 commit 848895c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cljs/cljs/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,12 @@ reduces them without incurring seq initialization"
"Return true if x satisfies IVector"
[x] (satisfies? IVector x))

(declare ChunkedCons ChunkedSeq)

(defn ^boolean chunked-seq?
[x] (satisfies? IChunkedSeq x))
[x]
(or (instance? ChunkedCons x)
(instance? ChunkedSeq x)))

;;;;;;;;;;;;;;;;;;;; js primitives ;;;;;;;;;;;;
(defn js-obj
Expand Down

0 comments on commit 848895c

Please sign in to comment.