Created
March 5, 2015 18:30
-
-
Save joshkh/83a5994c9b546bdf996a to your computer and use it in GitHub Desktop.
make-tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn make-tree-orig | |
([coll] (info "SINGLERUN")(let [root (first (remove :parent_id coll))] | |
{:node root :children (make-tree-orig root coll)})) | |
([root coll list] | |
(info "DOUBLERUN") (for [x coll :when (= (:parent_id x) (:id root))] | |
{:node x :children (make-tree-orig x coll)}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment