From 6dc84315ac3181753d712dab97ff3457102f3e6a Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Fri, 15 May 2020 11:26:06 +0200 Subject: [PATCH] Classpath optimizations - thanks @mbjarland --- src/babashka/impl/classpath.clj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/babashka/impl/classpath.clj b/src/babashka/impl/classpath.clj index d8f06a7d..07d56b28 100644 --- a/src/babashka/impl/classpath.clj +++ b/src/babashka/impl/classpath.clj @@ -19,8 +19,7 @@ (when (.exists f) (if url? ;; manual conversion, faster than going through .toURI - (java.net.URL. (str "file:" - (.getCanonicalPath f))) + (java.net.URL. "file" nil (.getCanonicalPath f)) {:file (.getCanonicalPath f) :source (slurp f)})))) resource-paths))) @@ -32,8 +31,8 @@ (when-let [entry (.getEntry jar path)] (if url? ;; manual conversion, faster than going through .toURI - (java.net.URL. - (str "jar:file:" (.getCanonicalPath jar-file) "!/" path)) + (java.net.URL. "jar" nil + (str "file:" (.getCanonicalPath jar-file) "!/" path)) {:file path :source (slurp (.getInputStream jar entry))}))) resource-paths)))