aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.dev>2026-02-28 10:42:43 +0200
committerBozhidar Batsov <bozhidar@batsov.dev>2026-02-28 10:51:37 +0200
commitefd0a0abe1956d4a3d0f7ce0eefc2059766e8009 (patch)
treee78242c80dc1bf17afe9b8603f6405b6bdd4ecf5
parent97fa0b8f69ad21d6ac44e6dac3e755c4582e70de (diff)
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.
-rw-r--r--projectile.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/projectile.el b/projectile.el
index 5a8e2ba..1a4429e 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)