mirror of
https://github.com/org-roam/org-roam
synced 2025-08-01 12:17:21 -05:00
(performance): avoid path expansion by referencing cache obj (#184)
Prevent needless repeated calls to org-roam-directory-normalized by having a reference to the cache object that matches the local buffer. Co-authored-by: Jethro Kuan <jethrokuan95@gmail.com>
This commit is contained in:
@ -68,11 +68,11 @@
|
||||
(defun org-roam--test-build-cache ()
|
||||
"Builds the caches synchronously."
|
||||
(let ((cache (org-roam--build-cache org-roam-directory)))
|
||||
(org-roam--set-directory-cache
|
||||
(org-roam-cache :initialized t
|
||||
:forward-links (plist-get cache :forward)
|
||||
:backward-links (plist-get cache :backward)
|
||||
:titles (plist-get cache :titles)))))
|
||||
(let ((obj (org-roam--get-directory-cache)))
|
||||
(oset obj initialized t)
|
||||
(oset obj forward-links (plist-get cache :forward))
|
||||
(oset obj backward-links (plist-get cache :backward))
|
||||
(oset obj titles (plist-get cache :titles)))))
|
||||
|
||||
;;; Tests
|
||||
(describe "org-roam--build-cache-async"
|
||||
|
Reference in New Issue
Block a user