core: assoc: Prepare for M2-Planet.

* src/mes.c (assoc): Prepare for M2-Planet.
This commit is contained in:
Jan Nieuwenhuizen 2019-10-24 19:02:44 +02:00
parent bb17ad617e
commit b88bf5186d
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 6 additions and 4 deletions

View File

@ -291,10 +291,12 @@ assoc (SCM x, SCM a)
{
if (TYPE (x) == TSTRING)
return assoc_string (x, a);
while (a != cell_nil && equal2_p (x, CAAR (a)) == cell_f)
a = CDR (a);
if (a != cell_nil)
return CAR (a);
while (a != cell_nil)
{
if (equal2_p (x, CAAR (a)) == cell_t)
return CAR (a);
a = CDR (a);
}
return cell_f;
}