We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bc22338 + 3175e25 commit 6124429Copy full SHA for 6124429
src/refactor_nrepl/ns/clean_ns.clj
@@ -36,13 +36,10 @@
36
(assert-no-exclude-clause (core/get-ns-component ns-form :use))
37
ns-form)
38
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
-
44
(defn clean-ns [{:keys [path relative-path]}]
45
- (let [path (find #(and % (.exists (io/file %)))
+ (let [path (some (fn [p]
+ (when (and p (.exists (io/file p)))
+ p))
46
[path relative-path])]
47
(assert (core/source-file? path))
48
;; Prefix notation not supported in cljs.
0 commit comments