Skip to content

Commit

Permalink
Added replace-all!
Browse files Browse the repository at this point in the history
  • Loading branch information
cnuernber committed Oct 26, 2021
1 parent ed482a3 commit b9d588f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tech/v3/datatype/jvm_map.clj
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@
(.computeIfAbsent ^Map map k (->bi-function val-fn)))


(defn replace-all!
"Replace all the values in the map with new values computed with val-fn. val-fn gets passed
the key and the existing value and must return a new value."
[map val-fn]
(.replaceAll ^Map map (->bi-function val-fn))
map)


(extend-protocol dt-proto/PClone
HashMap
(clone [item] (.clone item))
Expand Down

0 comments on commit b9d588f

Please sign in to comment.