[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ac341cd: Restore Emacs 27 image cache semantics
From: |
Lars Ingebrigtsen |
Subject: |
master ac341cd: Restore Emacs 27 image cache semantics |
Date: |
Tue, 8 Dec 2020 18:42:17 -0500 (EST) |
branch: master
commit ac341cd629cfcf7e6e15321f8b53100cc6c0507f
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Restore Emacs 27 image cache semantics
* src/image.c (equal_lists): Remove.
(search_image_cache): Use Fequal instead of equal_lists.
Benchmarking shows no measurable time difference, and this
restores the cache semantics from Emacs 27 (where file names
didn't have to be EQ for the cache to be used).
---
src/image.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/image.c b/src/image.c
index 5eb4132..846f2d1 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1592,17 +1592,6 @@ make_image_cache (void)
return c;
}
-/* Compare two lists (one of which must be proper), comparing each
- element with `eq'. */
-static bool
-equal_lists (Lisp_Object a, Lisp_Object b)
-{
- while (CONSP (a) && CONSP (b) && EQ (XCAR (a), XCAR (b)))
- a = XCDR (a), b = XCDR (b);
-
- return EQ (a, b);
-}
-
/* Find an image matching SPEC in the cache, and return it. If no
image is found, return NULL. */
static struct image *
@@ -1630,7 +1619,7 @@ search_image_cache (struct frame *f, Lisp_Object spec,
EMACS_UINT hash,
for (img = c->buckets[i]; img; img = img->next)
if (img->hash == hash
- && equal_lists (img->spec, spec)
+ && !NILP (Fequal (img->spec, spec))
&& (ignore_colors || (img->face_foreground == foreground
&& img->face_background == background)))
break;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master ac341cd: Restore Emacs 27 image cache semantics,
Lars Ingebrigtsen <=