branch: elpa/projectile
commit efd0a0abe1956d4a3d0f7ce0eefc2059766e8009
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Fix duplicate projectile-project-root call in cache-current-file
    
    Reuse the already-resolved `current-project` binding instead of
    calling projectile-project-root a second time. Avoids redundant
    root resolution and a subtle correctness risk if the two calls
    returned different values.
---
 projectile.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/projectile.el b/projectile.el
index 5a8e2bad0c..1a4429e439 100644
--- a/projectile.el
+++ b/projectile.el
@@ -1200,7 +1200,7 @@ The cache is created both in memory and on the hard 
drive."
   (let ((current-project (projectile-project-root)))
     (when (and (buffer-file-name)
                (file-exists-p (buffer-file-name))
-               (gethash (projectile-project-root) projectile-projects-cache))
+               (gethash current-project projectile-projects-cache))
       (let* ((abs-current-file (file-truename (buffer-file-name)))
              (current-file (file-relative-name abs-current-file 
current-project)))
         (unless (or (projectile-file-cached-p current-file current-project)

Reply via email to