add update-fast
This commit is contained in:
parent
47aee4d000
commit
b20d035950
1 changed files with 9 additions and 0 deletions
|
|
@ -67,6 +67,15 @@
|
||||||
(apply update-fn (conj vals structure)))
|
(apply update-fn (conj vals structure)))
|
||||||
))))
|
))))
|
||||||
|
|
||||||
|
(defn update-fast [^com.rpl.specter.impl.StructureValsPathFunctions selfns update-fn structure]
|
||||||
|
((.updater selfns) [] structure
|
||||||
|
(fn [vals structure]
|
||||||
|
(if (empty? vals)
|
||||||
|
(update-fn structure)
|
||||||
|
(apply update-fn (conj vals structure)))
|
||||||
|
))
|
||||||
|
)
|
||||||
|
|
||||||
(defn setval
|
(defn setval
|
||||||
"Navigates to each value specified by the selector and replaces it by val"
|
"Navigates to each value specified by the selector and replaces it by val"
|
||||||
[selector val structure]
|
[selector val structure]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue