~severeoverfl0w/slow-namespace-clj

9be47f30cbf52e299d67635a693038d10c9fcbc8 — Dominic Monroe 1 year, 11 months ago d47bb92
Fix double call to ns-graph
1 files changed, 4 insertions(+), 5 deletions(-)

M src/io/dominic/slow_namespace_clj/core.clj
M src/io/dominic/slow_namespace_clj/core.clj => src/io/dominic/slow_namespace_clj/core.clj +4 -5
@@ 92,10 92,9 @@

(defn- run
  ([] (run {}))
  ([{:keys [threshold ns-graph]
     :or {threshold 0.1
          ns-graph (ns-graph)}}]
   (let [timing (ns-timing ns-graph)
  ([{:keys [threshold graph]
     :or {threshold 0.1}}]
   (let [timing (ns-timing (or graph (ns-graph)))
         prefix-timing (prefix-timing timing)]
     (doseq [[ns ttr] (sort-by val timing)
             :when (> ttr threshold)]


@@ 108,5 107,5 @@
  [& dirs]
  (binding [*safe* true]
    (if (seq dirs)
      (run {:ns-graph (ns-graph (map #(java.io.File. %) dirs))})
      (run {:graph (ns-graph (map #(java.io.File. %) dirs))})
      (run))))