Subject: bug#27584: 26.0.50; alist-get: Add optional arg TESTFN

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Jul 2017 09:30:00 +0300

> From: Nicolas Petton <[email-masked]>
> Date: Fri, 07 Jul 2017 21:47:03 +0200
> Cc: [email-masked], Tino Calancha <[email-masked]>
> 
> +      if (NILP (testfn))
> +	{
> +	  if (CONSP (car)
> +	      && (EQ (XCAR (car), key) || !NILP (Fequal (XCAR (car), key))))
> +	    return car;
> +	}
> +      else if (CONSP (car) && (!NILP (call2 (testfn, (XCAR (car)), key))))
> +	{
> +	  return car;
> +	}

No need for braces when there's only one line to enclose.
Also, no need for parentheses around "!NILP (...)".

Bonus points for simplifying the code by determining TESTFN up front,
then having only one of the above two clauses.

Thanks.