mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-14 05:12:38 -08:00
c_leta: don't compute whole list length for optimization
This is interpreter performance tweak. Behavior stays the same. Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
This commit is contained in:
parent
64d0b5586a
commit
7a59ebda66
1 changed files with 4 additions and 4 deletions
|
|
@ -1551,10 +1551,10 @@ c_let_leta(cl_env_ptr env, int op, cl_object args, int flags) {
|
|||
specials = env->values[3];
|
||||
|
||||
/* Optimize some common cases */
|
||||
switch(ecl_length(bindings)) {
|
||||
case 0: return c_locally(env, CDR(args), flags);
|
||||
case 1: op = OP_BIND; break;
|
||||
}
|
||||
if (bindings == ECL_NIL)
|
||||
return c_locally(env, CDR(args), flags);
|
||||
if (ECL_CONS_CDR(bindings) == ECL_NIL)
|
||||
op = OP_BIND;
|
||||
|
||||
for (vars=ECL_NIL, l=bindings; !Null(l); ) {
|
||||
cl_object aux = pop(&l);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue