From cf26ebe85bd395e2f95fd16b8ff4ddec5427c8a4 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 14 Jun 2007 01:48:01 +0000 Subject: [PATCH] (search_image_cache): Remove unused variable. --- src/image.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/image.c b/src/image.c index 36e8a2ecb80..2dd578afc39 100644 --- a/src/image.c +++ b/src/image.c @@ -1642,21 +1642,26 @@ search_image_cache (f, spec, hash) { struct image *img; struct image_cache *c = FRAME_X_IMAGE_CACHE (f); - Lisp_Object specified_bg = image_spec_value (spec, QCbackground, NULL); int i = hash % IMAGE_CACHE_BUCKETS_SIZE; /* If the image spec does not specify a background color, the cached image must have the same background color as the current frame. - Likewise for the foreground color of the cached monochrome image. - The following code be improved. For example, jpeg does not - support transparency, but currently a jpeg image spec won't match - a cached spec created with a different frame background. The - extra memory usage is probably negligible in practice. */ + The foreground color must also match, for the sake of monochrome + images. + + In fact, we could ignore the foreground color matching condition + for color images, or if the image spec specifies :foreground; + similarly we could ignore the background color matching condition + for formats that don't use transparency (such as jpeg), or if the + image spec specifies :background. However, the extra memory + usage is probably negligible in practice, so we don't bother. */ if (!c) return NULL; for (img = c->buckets[i]; img; img = img->next) if (img->hash == hash && !NILP (Fequal (img->spec, spec)) + /* If the image spec specifies a background, it doesn't matter + what the frame background is. */ && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f) && img->frame_background == FRAME_BACKGROUND_PIXEL (f)) break; -- 2.39.2