Skip to content

Commit

Permalink
Instantiate re-pattern once
Browse files Browse the repository at this point in the history
  • Loading branch information
hisaitami committed Nov 5, 2023
1 parent 787db69 commit 04a8930
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tldr.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@
"local database")))))

(defn list-localdb [platform]
(let [path (cache-path platform)]
(let [path (cache-path platform)
re (re-pattern (str page-suffix "$"))]
(or (io/exists? path) (die "Can't open cache directory:" path))
(println (format "# Pages for"))
(doseq [file (io/list-files path)]
(let [r (re-pattern (str page-suffix "$"))
entry (s/replace (io/file-name file) r "")]
(let [entry (s/replace (io/file-name file) re "")]
(println entry)))))

(defn check-localdb []
Expand Down

0 comments on commit 04a8930

Please sign in to comment.