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)