emacs-diffs
[Top][All Lists]
Advanced

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

master 85acde2: Make uncache_image slightly more efficient


From: Lars Ingebrigtsen
Subject: master 85acde2: Make uncache_image slightly more efficient
Date: Tue, 8 Dec 2020 19:10:15 -0500 (EST)

branch: master
commit 85acde2ab5c2327c8f70ea3c284f26de4a44128b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make uncache_image slightly more efficient
    
    * src/image.c (uncache_image): Extremely minor speed-up: Only
    compute the hash once.
---
 src/image.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/image.c b/src/image.c
index 846f2d1..522a4cf 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1633,12 +1633,13 @@ static void
 uncache_image (struct frame *f, Lisp_Object spec)
 {
   struct image *img;
+  EMACS_UINT hash = sxhash (spec);
 
   /* Because the background colors are based on the current face, we
      can have multiple copies of an image with the same spec. We want
      to remove them all to ensure the user doesn't see an old version
      of the image when the face changes.  */
-  while ((img = search_image_cache (f, spec, sxhash (spec), 0, 0, true)))
+  while ((img = search_image_cache (f, spec, hash, 0, 0, true)))
     {
       free_image (f, img);
       /* As display glyphs may still be referring to the image ID, we



reply via email to

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