aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-04-22 12:34:26 -0700
committerPaul Eggert2019-04-22 12:35:14 -0700
commitb8e7be28336ea02e899fbf4a67780e0528327d1a (patch)
tree06a0a4a2bb47f515acc5e668a71db453f9233e3d
parent8882419798bb9508fce23e6c4a85df7f9876dda8 (diff)
downloademacs-b8e7be28336ea02e899fbf4a67780e0528327d1a.tar.gz
emacs-b8e7be28336ea02e899fbf4a67780e0528327d1a.zip
Tweak Vinternal_interpreter_environment lookup
* src/eval.c (Fsetq, eval_sub): Use assq_no_quit instead of Fassq for a list that cannot contain cycles or be that long.
-rw-r--r--src/eval.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/eval.c b/src/eval.c
index 4693767ce7e..fde63f1a21c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -501,7 +501,7 @@ usage: (setq [SYM VAL]...) */)
501 501
502 for (EMACS_INT nargs = 0; CONSP (tail); nargs += 2) 502 for (EMACS_INT nargs = 0; CONSP (tail); nargs += 2)
503 { 503 {
504 Lisp_Object sym = XCAR (tail), lex_binding; 504 Lisp_Object sym = XCAR (tail);
505 tail = XCDR (tail); 505 tail = XCDR (tail);
506 if (!CONSP (tail)) 506 if (!CONSP (tail))
507 xsignal2 (Qwrong_number_of_arguments, Qsetq, make_fixnum (nargs + 1)); 507 xsignal2 (Qwrong_number_of_arguments, Qsetq, make_fixnum (nargs + 1));
@@ -510,10 +510,12 @@ usage: (setq [SYM VAL]...) */)
510 val = eval_sub (arg); 510 val = eval_sub (arg);
511 /* Like for eval_sub, we do not check declared_special here since 511 /* Like for eval_sub, we do not check declared_special here since
512 it's been done when let-binding. */ 512 it's been done when let-binding. */
513 if (!NILP (Vinternal_interpreter_environment) /* Mere optimization! */ 513 Lisp_Object lex_binding
514 && SYMBOLP (sym) 514 = ((!NILP (Vinternal_interpreter_environment) /* Mere optimization! */
515 && !NILP (lex_binding 515 && SYMBOLP (sym))
516 = Fassq (sym, Vinternal_interpreter_environment))) 516 ? assq_no_quit (sym, Vinternal_interpreter_environment)
517 : Qnil);
518 if (!NILP (lex_binding))
517 XSETCDR (lex_binding, val); /* SYM is lexically bound. */ 519 XSETCDR (lex_binding, val); /* SYM is lexically bound. */
518 else 520 else
519 Fset (sym, val); /* SYM is dynamically bound. */ 521 Fset (sym, val); /* SYM is dynamically bound. */
@@ -2159,9 +2161,9 @@ eval_sub (Lisp_Object form)
2159 We do not pay attention to the declared_special flag here, since we 2161 We do not pay attention to the declared_special flag here, since we
2160 already did that when let-binding the variable. */ 2162 already did that when let-binding the variable. */
2161 Lisp_Object lex_binding 2163 Lisp_Object lex_binding
2162 = !NILP (Vinternal_interpreter_environment) /* Mere optimization! */ 2164 = (!NILP (Vinternal_interpreter_environment) /* Mere optimization! */
2163 ? Fassq (form, Vinternal_interpreter_environment) 2165 ? assq_no_quit (form, Vinternal_interpreter_environment)
2164 : Qnil; 2166 : Qnil);
2165 return !NILP (lex_binding) ? XCDR (lex_binding) : Fsymbol_value (form); 2167 return !NILP (lex_binding) ? XCDR (lex_binding) : Fsymbol_value (form);
2166 } 2168 }
2167 2169