Skip to content

Commit

Permalink
Improve merge-with to work with map-like types that don't implement c…
Browse files Browse the repository at this point in the history
…lojure.lang.IFn for lookup

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information
khinsen authored and stuarthalloway committed Jun 4, 2010
1 parent fde4f64 commit 673f4c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clj/clojure/core.clj
Expand Up @@ -2273,7 +2273,7 @@
(let [merge-entry (fn [m e]
(let [k (key e) v (val e)]
(if (contains? m k)
(assoc m k (f (m k) v))
(assoc m k (f (get m k) v))
(assoc m k v))))
merge2 (fn [m1 m2]
(reduce merge-entry (or m1 {}) (seq m2)))]
Expand Down

0 comments on commit 673f4c7

Please sign in to comment.