Improvements to historoy management.

This commit is contained in:
Andrey Antukh 2016-03-30 20:56:44 +03:00
parent 6245ccc599
commit 37454ca305
6 changed files with 284 additions and 162 deletions

View file

@ -45,6 +45,14 @@
(when (= v x) idx))
coll)))
(defn replace-by-id
[coll value]
{:pre [(vector? coll)]}
(mapv (fn [item]
(if (= (:id item) (:id value))
value
item)) coll))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Numbers Parsing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;