remove use of transients
This commit is contained in:
parent
3750dd73f5
commit
59a1f742bf
1 changed files with 4 additions and 5 deletions
|
|
@ -102,20 +102,19 @@
|
||||||
ret
|
ret
|
||||||
))))
|
))))
|
||||||
|
|
||||||
(defn- conj-all! [atrans elems]
|
(defn- conj-all! [cell elems]
|
||||||
(doseq [e elems]
|
(set-cell! cell (concat (get-cell cell) elems)))
|
||||||
(conj! atrans e)))
|
|
||||||
|
|
||||||
;; returns vector of all results
|
;; returns vector of all results
|
||||||
(defn- walk-select [pred continue-fn structure]
|
(defn- walk-select [pred continue-fn structure]
|
||||||
(let [ret (transient [])
|
(let [ret (mutable-cell [])
|
||||||
walker (fn this [structure]
|
walker (fn this [structure]
|
||||||
(if (pred structure)
|
(if (pred structure)
|
||||||
(conj-all! ret (continue-fn structure))
|
(conj-all! ret (continue-fn structure))
|
||||||
(walk/walk this identity structure))
|
(walk/walk this identity structure))
|
||||||
)]
|
)]
|
||||||
(walker structure)
|
(walker structure)
|
||||||
(persistent! ret)
|
(get-cell ret)
|
||||||
))
|
))
|
||||||
|
|
||||||
(defn- filter+ancestry [afn aseq]
|
(defn- filter+ancestry [afn aseq]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue