Skip to content

Commit

Permalink
CLJS-368: Make empty? faster for nil calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
edtsech authored and David Nolen committed Oct 17, 2012
1 parent 4defcbc commit 69897cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cljs/cljs/core.cljs
Expand Up @@ -905,7 +905,8 @@ reduces them without incurring seq initialization"
(defn ^boolean empty?
"Returns true if coll has no items - same as (not (seq coll)).
Please use the idiom (seq x) rather than (not (empty? x))"
[coll] (not (seq coll)))
[coll] (or (nil? coll)
(not (seq coll))))

(defn ^boolean coll?
"Returns true if x satisfies ICollection"
Expand Down

0 comments on commit 69897cf

Please sign in to comment.