Skip to content

Commit 6124429

Browse files
authored
Merge pull request #252 from plexus/clean-ns-followup
Use seek instead of find, the latter already exists in clojure.core
2 parents bc22338 + 3175e25 commit 6124429

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/refactor_nrepl/ns/clean_ns.clj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@
3636
(assert-no-exclude-clause (core/get-ns-component ns-form :use))
3737
ns-form)
3838

39-
(defn- find
40-
"Find the first element in coll that satisfies pred?"
41-
[pred? coll]
42-
(reduce (fn [_ x] (when (pred? x) (reduced x))) nil coll))
43-
4439
(defn clean-ns [{:keys [path relative-path]}]
45-
(let [path (find #(and % (.exists (io/file %)))
40+
(let [path (some (fn [p]
41+
(when (and p (.exists (io/file p)))
42+
p))
4643
[path relative-path])]
4744
(assert (core/source-file? path))
4845
;; Prefix notation not supported in cljs.

0 commit comments

Comments
 (0)