huge speedup for cond-path

This commit is contained in:
Nathan Marz 2016-06-04 14:51:26 -04:00
parent b6e1f5f20f
commit 59423c358e

View file

@ -696,15 +696,18 @@
)) ))
(defn retrieve-cond-selector [cond-paths structure] (defn retrieve-cond-selector [cond-paths structure]
(->> cond-paths (let [aseq (seq cond-paths)]
(partition 2) (if aseq
(drop-while (fn [[c-selector _]] (loop [s aseq]
(->> structure (let [tester (first s)
(compiled-select* c-selector) s2 (next s)
empty?))) res (first s2)]
first (if (empty? (compiled-select* tester structure))
second (let [s3 (next s2)]
)) (if s3 (recur s3))
)
res
))))))
(defn filter-select [afn structure next-fn] (defn filter-select [afn structure next-fn]
(if (afn structure) (if (afn structure)