[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: member inconsistency?
From: |
Stephen Berman |
Subject: |
Re: member inconsistency? |
Date: |
Thu, 28 Jan 2016 23:41:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
On Thu, 28 Jan 2016 23:18:29 +0100 Andreas Schwab <address@hidden> wrote:
> Stephen Berman <address@hidden> writes:
>
>> diff --git a/src/fns.c b/src/fns.c
>> index 86ad333..17c4a75 100644
>> --- a/src/fns.c
>> +++ b/src/fns.c
>> @@ -1349,7 +1349,7 @@ The value is actually the tail of LIST whose car is
>> ELT. */)
>> (register Lisp_Object elt, Lisp_Object list)
>> {
>> register Lisp_Object tail;
>> - for (tail = list; CONSP (tail); tail = XCDR (tail))
>> + for (tail = list; CONSP (tail) || !NILP (tail); tail = XCDR (tail))
>> {
>> register Lisp_Object tem;
>> CHECK_LIST_CONS (tail, list);
>
> The check for CONSP in the loop condition is redundant, that is already
> checked by CHECK_LIST_CONS (and the latter was a no-op before).
Thanks. So is the following patch ok to commit to emacs-25?
diff --git a/src/fns.c b/src/fns.c
index 86ad333..b75f0c8 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1349,7 +1349,7 @@ The value is actually the tail of LIST whose car is ELT.
*/)
(register Lisp_Object elt, Lisp_Object list)
{
register Lisp_Object tail;
- for (tail = list; CONSP (tail); tail = XCDR (tail))
+ for (tail = list; !NILP (tail); tail = XCDR (tail))
{
register Lisp_Object tem;
CHECK_LIST_CONS (tail, list);
@@ -1397,7 +1397,7 @@ The value is actually the tail of LIST whose car is ELT.
*/)
if (!FLOATP (elt))
return Fmemq (elt, list);
- for (tail = list; CONSP (tail); tail = XCDR (tail))
+ for (tail = list; !NILP (tail); tail = XCDR (tail))
{
register Lisp_Object tem;
CHECK_LIST_CONS (tail, list);
- member inconsistency?, Nicolas Goaziou, 2016/01/28
- Re: member inconsistency?, Philipp Stephani, 2016/01/28
- Re: member inconsistency?, Andreas Schwab, 2016/01/28
- Re: member inconsistency?, Stephen Berman, 2016/01/28
- Re: member inconsistency?, Eli Zaretskii, 2016/01/28
- Re: member inconsistency?, Stephen Berman, 2016/01/28
- Re: member inconsistency?, Eli Zaretskii, 2016/01/28
- Re: member inconsistency?, Stephen Berman, 2016/01/28
- Re: member inconsistency?, Andreas Schwab, 2016/01/28
- Re: member inconsistency?,
Stephen Berman <=
- Re: member inconsistency?, Johan Bockgård, 2016/01/28
- Re: member inconsistency?, Stephen Berman, 2016/01/28
- Re: member inconsistency?, Andreas Schwab, 2016/01/29
- Re: member inconsistency?, Stephen Berman, 2016/01/29
- Re: member inconsistency?, Eli Zaretskii, 2016/01/29
- Re: member inconsistency?, John Wiegley, 2016/01/29
- Re: member inconsistency?, Richard Stallman, 2016/01/29