From: Stefan Kangas Date: Thu, 4 Jan 2024 00:49:34 +0000 (+0100) Subject: Prefer NILP (x) to EQ (x, Qnil) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3daa19837ecbe13c35084512e0586c10cd96caa5;p=emacs.git Prefer NILP (x) to EQ (x, Qnil) * src/image.c (anim_prune_animation_cache): Prefer NILP (x) to EQ (x, Qnil). * admin/coccinelle/nilp.cocci: Semantic patch for above change. (cherry picked from commit 88ed501abe9666fced46703613c000c26e450ad8) --- diff --git a/admin/coccinelle/nilp.cocci b/admin/coccinelle/nilp.cocci new file mode 100644 index 00000000000..ccebbbe1c80 --- /dev/null +++ b/admin/coccinelle/nilp.cocci @@ -0,0 +1,6 @@ +// Prefer NILP (x) to EQ (x, Qnil) +@@ +expression X; +@@ +- EQ (X, Qnil) ++ NILP (X) diff --git a/src/image.c b/src/image.c index f09552c4017..dea2730832b 100644 --- a/src/image.c +++ b/src/image.c @@ -3561,7 +3561,7 @@ anim_prune_animation_cache (Lisp_Object clear) { struct anim_cache *cache = *pcache; if (EQ (clear, Qt) - || (EQ (clear, Qnil) && timespec_cmp (old, cache->update_time) > 0) + || (NILP (clear) && timespec_cmp (old, cache->update_time) > 0) || EQ (clear, cache->spec)) { if (cache->handle)