add update-fast

This commit is contained in:
Nathan Marz 2015-05-10 08:09:48 -04:00
parent 47aee4d000
commit b20d035950

View file

@ -67,6 +67,15 @@
(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
"Navigates to each value specified by the selector and replaces it by val"
[selector val structure]