clojure.set/union

functionsince v0.0-927 clojure.set/unionEdit
(union)
(union s1)
(union s1 s2)
(union s1 s2 & sets)

Details:

Return a set that is the union of the input sets.


See Also:


Source docstring:
Return a set that is the union of the input sets
Source code @ clojurescript:src/main/cljs/clojure/set.cljs
(defn union
  ([] #{})
  ([s1] s1)
  ([s1 s2]
     (if (< (count s1) (count s2))
       (reduce conj s2 s1)
       (reduce conj s1 s2)))
  ([s1 s2 & sets]
     (let [bubbled-sets (bubble-max-key count (conj sets s2 s1))]
       (reduce into (first bubbled-sets) (rest bubbled-sets)))))