core: last_pair: Prepare for M2-Planet.

* src/lib.c (last_pair): Prepare for M2-Planet.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-07-16 21:25:06 +02:00
parent c48b847bf7
commit 9c099977a0
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -204,8 +204,12 @@ equal2:
SCM
last_pair (SCM x)
{
while (x != cell_nil && CDR (x) != cell_nil)
x = CDR (x);
while (x != cell_nil)
{
if (CDR (x) == cell_nil)
return x;
x = CDR (x);
}
return x;
}