From 59a1f742bf3612cd86f6f9fd568de45dc67d7b31 Mon Sep 17 00:00:00 2001 From: Nathan Marz Date: Thu, 26 Feb 2015 15:58:16 -0500 Subject: [PATCH] remove use of transients --- src/clj/com/rpl/specter/impl.clj | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/clj/com/rpl/specter/impl.clj b/src/clj/com/rpl/specter/impl.clj index 296fc05..9891885 100644 --- a/src/clj/com/rpl/specter/impl.clj +++ b/src/clj/com/rpl/specter/impl.clj @@ -102,20 +102,19 @@ ret )))) -(defn- conj-all! [atrans elems] - (doseq [e elems] - (conj! atrans e))) +(defn- conj-all! [cell elems] + (set-cell! cell (concat (get-cell cell) elems))) ;; returns vector of all results (defn- walk-select [pred continue-fn structure] - (let [ret (transient []) + (let [ret (mutable-cell []) walker (fn this [structure] (if (pred structure) (conj-all! ret (continue-fn structure)) (walk/walk this identity structure)) )] (walker structure) - (persistent! ret) + (get-cell ret) )) (defn- filter+ancestry [afn aseq]