improve performance of non-compiled code path by 3x, remove ability for a vector to be considered a structurepath
This commit is contained in:
parent
4e268629c3
commit
c47650993d
2 changed files with 6 additions and 6 deletions
|
|
@ -153,7 +153,7 @@
|
||||||
e.g. (selected? :vals ALL even?) keeps the current element only if an
|
e.g. (selected? :vals ALL even?) keeps the current element only if an
|
||||||
even number exists for the :vals key"
|
even number exists for the :vals key"
|
||||||
[& selectors]
|
[& selectors]
|
||||||
(let [s (comp-paths selectors)]
|
(let [s (comp-paths* selectors)]
|
||||||
(fn [structure]
|
(fn [structure]
|
||||||
(->> structure
|
(->> structure
|
||||||
(select s)
|
(select s)
|
||||||
|
|
|
||||||
|
|
@ -97,17 +97,17 @@
|
||||||
updater (.updater sp)]
|
updater (.updater sp)]
|
||||||
(->StructureValsPathFunctions
|
(->StructureValsPathFunctions
|
||||||
(fn [vals structure next-fn]
|
(fn [vals structure next-fn]
|
||||||
(selector vals structure
|
(curr-selector vals structure
|
||||||
(fn [vals-next structure-next]
|
(fn [vals-next structure-next]
|
||||||
(curr-selector vals-next structure-next next-fn)
|
(selector vals-next structure-next next-fn)
|
||||||
)))
|
)))
|
||||||
(fn [vals structure next-fn]
|
(fn [vals structure next-fn]
|
||||||
(updater vals structure
|
(curr-updater vals structure
|
||||||
(fn [vals-next structure-next]
|
(fn [vals-next structure-next]
|
||||||
(curr-updater vals-next structure-next next-fn)
|
(updater vals-next structure-next next-fn)
|
||||||
)))
|
)))
|
||||||
)))
|
)))
|
||||||
(->> structure-paths flatten (map coerce-path) reverse))
|
(map coerce-path structure-paths))
|
||||||
))
|
))
|
||||||
|
|
||||||
;; cell implementation idea taken from prismatic schema library
|
;; cell implementation idea taken from prismatic schema library
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue