core: last_pair: Prepare for M2-Planet.

* src/lib.c (last_pair): Prepare for M2-Planet.
This commit is contained in:
Jan Nieuwenhuizen 2019-10-24 21:25:06 +02:00
parent d2ef299879
commit f3e443a752
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 6 additions and 2 deletions

View File

@ -198,8 +198,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;
}