another perf enhancement

This commit is contained in:
Nathan Marz 2016-09-01 23:20:53 -04:00
parent dc6740d9dc
commit 1d52e970a0

View file

@ -257,7 +257,19 @@
(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 #?(
: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] (defn compiled-traverse* [path result-fn structure]
(exec-select* (exec-select*
path path
@ -266,7 +278,7 @@
(fn [vals structure] (fn [vals structure]
(if (identical? vals []) (if (identical? vals [])
(result-fn structure) (result-fn structure)
(result-fn (conj vals structure)))))) (result-fn (conj vals structure)))))))