emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/slime 321ec0c032 02/43: Don't allow duplicate entries in t


From: ELPA Syncer
Subject: [nongnu] elpa/slime 321ec0c032 02/43: Don't allow duplicate entries in the source file cache.
Date: Thu, 28 Dec 2023 22:00:28 -0500 (EST)

branch: elpa/slime
commit 321ec0c032cf5cecb4f715719aae29ddcfd243e6
Author: Gabor Melis <(none)>
Commit: Stas Boukarev <stassats@gmail.com>

    Don't allow duplicate entries in the source file cache.
    
    It's an EQUAL hash table, so make sure NAMESTRINGs are converted to
    PATHNAMEs. This assumes that the filename is never NIL.
---
 swank/source-file-cache.lisp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/swank/source-file-cache.lisp b/swank/source-file-cache.lisp
index e639ea114e..a6869609f8 100644
--- a/swank/source-file-cache.lisp
+++ b/swank/source-file-cache.lisp
@@ -71,7 +71,8 @@ If the exact version cannot be found then return the current 
one from disk."
   "Return the source code for FILENAME as written on DATE in a string.
 Return NIL if the right version cannot be found."
   (when *cache-sourcecode*
-    (let ((entry (gethash filename *source-file-cache*)))
+    (let* ((filename (pathname filename))
+           (entry (gethash filename *source-file-cache*)))
       (cond ((and entry (equal date (source-cache-entry.date entry)))
              ;; Cache hit.
              (source-cache-entry.text entry))
@@ -88,7 +89,7 @@ Return NIL if the right version cannot be found."
 
 (defun source-cached-p (filename)
   "Is any version of FILENAME in the source cache?"
-  (if (gethash filename *source-file-cache*) t))
+  (if (gethash (pathname filename) *source-file-cache*) t))
 
 (defun read-file (filename)
   "Return the entire contents of FILENAME as a string."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]