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.
This commit is contained in:
Stefan Kangas 2024-01-04 01:49:34 +01:00
parent bdfa49502a
commit 88ed501abe
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,6 @@
// Prefer NILP (x) to EQ (x, Qnil)
@@
expression X;
@@
- EQ (X, Qnil)
+ NILP (X)

View file

@ -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)