another perf enhancement
This commit is contained in:
parent
dc6740d9dc
commit
1d52e970a0
1 changed files with 22 additions and 10 deletions
|
|
@ -257,16 +257,28 @@
|
||||||
(set-cell! cell ret)
|
(set-cell! cell ret)
|
||||||
ret))
|
ret))
|
||||||
|
|
||||||
;; TODO: this used to be a macro for clj... check if that's still important
|
#?(
|
||||||
(defn compiled-traverse* [path result-fn structure]
|
:clj
|
||||||
(exec-select*
|
(defmacro compiled-traverse* [path result-fn structure]
|
||||||
path
|
`(exec-select*
|
||||||
[]
|
~path
|
||||||
structure
|
[]
|
||||||
(fn [vals structure]
|
~structure
|
||||||
(if (identical? vals [])
|
(fn [vals# structure#]
|
||||||
(result-fn structure)
|
(if (identical? vals# [])
|
||||||
(result-fn (conj vals structure))))))
|
(~result-fn structure#)
|
||||||
|
(~result-fn (conj vals# structure#))))))
|
||||||
|
|
||||||
|
:cljs
|
||||||
|
(defn compiled-traverse* [path result-fn structure]
|
||||||
|
(exec-select*
|
||||||
|
path
|
||||||
|
[]
|
||||||
|
structure
|
||||||
|
(fn [vals structure]
|
||||||
|
(if (identical? vals [])
|
||||||
|
(result-fn structure)
|
||||||
|
(result-fn (conj vals structure)))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue