(perf)db: require optional libraries only once per function (#1944)

Require optional libraries 'org-ref and 'oc only once per function run:
org-roam-db-update-file and org-roam-db-sync will call these requires at
the top level instead of within the link mapper.
This commit is contained in:
Jethro Kuan
2021-11-06 15:03:04 +08:00
committed by GitHub
parent 3e47f198c7
commit 84f58cbc12
2 changed files with 18 additions and 6 deletions

View File

@@ -34,6 +34,11 @@
(require 'org-roam)
(defun org-roam-require (libs)
"Require LIBS."
(dolist (lib libs)
(require lib nil 'noerror)))
;;; String utilities
;; TODO Refactor this.
(defun org-roam-replace-string (old new s)