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 committed by Jan Nieuwenhuizen
parent 7c91df5b2e
commit 5b336ddc96
1 changed files with 6 additions and 2 deletions

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;
}