File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -12721,3 +12721,15 @@ reduces them without incurring seq initialization"
1272112721 (-pr-writer [coll writer opts] (pr-sequential-writer writer pr-writer " #{" " " " }" opts coll)))
1272212722
1272312723(set! (. Set -EMPTY) (Set. nil (. HashMap -EMPTY) empty-unordered-hash))
12724+
12725+ (defn simple-set
12726+ [coll]
12727+ (if (set? coll)
12728+ (with-meta coll nil )
12729+ (let [in (seq coll)]
12730+ (if (nil? in)
12731+ #{}
12732+ (loop [in in out (. Set -EMPTY)]
12733+ (if-not (nil? in)
12734+ (recur (next in) (conj out (first in)))
12735+ out))))))
Original file line number Diff line number Diff line change 616616
617617 :else (emits " cljs.core.PersistentHashSet.createAsIfByAssoc([" (comma-sep items) " ])" )))
618618
619+ (defn emit-lite-set [items comma-sep distinct-constants?]
620+ (if (empty? items)
621+ (emits " cljs.core.Set.EMPTY" )
622+ (emits " cljs.core.simple_set([" (comma-sep items) " ])" )))
623+
619624(defmethod emit* :set
620625 [{:keys [items env]}]
621626 (emit-wrap env
622- (emit-set items comma-sep distinct-constants?)))
627+ (if (ana/lite-mode? )
628+ (emit-lite-set items comma-sep distinct-constants?)
629+ (emit-set items comma-sep distinct-constants?))))
623630
624631(defn emit-js-object [items emit-js-object-val]
625632 (emits " ({" )
You can’t perform that action at this time.
0 commit comments