Skip to content

Commit 8ad0d0c

Browse files
committed
separate merge arities
1 parent 396fab9 commit 8ad0d0c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/main/cljs/cljs/core.cljs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9292,9 +9292,11 @@ reduces them without incurring seq initialization"
92929292
"Returns a map that consists of the rest of the maps conj-ed onto
92939293
the first. If a key occurs in more than one map, the mapping from
92949294
the latter (left-to-right) will be the mapping in the result."
9295-
[& maps]
9296-
(when (some identity maps)
9297-
(reduce #(conj (or %1 {}) %2) maps)))
9295+
([] nil)
9296+
([x] x)
9297+
([x y] (if (and x y) (into x y) (or x y)))
9298+
([x y & maps]
9299+
(reduce merge (merge x y) maps)))
92989300

92999301
(defn merge-with
93009302
"Returns a map that consists of the rest of the maps conj-ed onto

0 commit comments

Comments
 (0)