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)
|
||||
ret))
|
||||
|
||||
;; TODO: this used to be a macro for clj... check if that's still important
|
||||
(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))))))
|
||||
#?(
|
||||
:clj
|
||||
(defmacro compiled-traverse* [path result-fn structure]
|
||||
`(exec-select*
|
||||
~path
|
||||
[]
|
||||
~structure
|
||||
(fn [vals# structure#]
|
||||
(if (identical? vals# [])
|
||||
(~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