File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13142,7 +13142,20 @@ reduces them without incurring seq initialization"
1314213142(set! (. SetLite -EMPTY) (SetLite. nil (. HashMapLite -EMPTY) empty-unordered-hash))
1314313143
1314413144(defn set-lite
13145- " :lite-mode version of set, not intended ot be used directly."
13145+ " :lite-mode version of set, not intended to be used directly."
13146+ [coll]
13147+ (if (set? coll)
13148+ (-with-meta coll nil )
13149+ (let [in (seq coll)]
13150+ (if (nil? in)
13151+ #{}
13152+ (loop [in in out (. SetLite -EMPTY)]
13153+ (if-not (nil? in)
13154+ (recur (next in) (conj out (first in)))
13155+ out))))))
13156+
13157+ (defn set-lite-check
13158+ " :lite-mode version of set with check, not intended to be used directly."
1314613159 [coll]
1314713160 (if (set? coll)
1314813161 (-with-meta coll nil )
Original file line number Diff line number Diff line change 617617 :else (emits " cljs.core.PersistentHashSet.createWithCheck([" (comma-sep items) " ])" )))
618618
619619(defn emit-lite-set [items comma-sep distinct-constants?]
620- (if (empty? items)
620+ (cond
621+ (empty? items)
621622 (emits " cljs.core.SetLite.EMPTY" )
622- (emits " cljs.core.set_lite([" (comma-sep items) " ])" )))
623+
624+ (distinct-constants? items)
625+ (emits " cljs.core.set_lite([" (comma-sep items) " ])" )
626+
627+ :else (emits " cljs.core.set_lite_check([" (comma-sep items) " ])" )))
623628
624629(defmethod emit* :set
625630 [{:keys [items env]}]
You can’t perform that action at this time.
0 commit comments