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"
12721
12721
(-pr-writer [coll writer opts] (pr-sequential-writer writer pr-writer " #{" " " " }" opts coll)))
12722
12722
12723
12723
(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 616
616
617
617
:else (emits " cljs.core.PersistentHashSet.createAsIfByAssoc([" (comma-sep items) " ])" )))
618
618
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
+
619
624
(defmethod emit* :set
620
625
[{:keys [items env]}]
621
626
(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?))))
623
630
624
631
(defn emit-js-object [items emit-js-object-val]
625
632
(emits " ({" )
You can’t perform that action at this time.
0 commit comments