From 8b17d6bd89cd79820c76bd88bc064e44fc03a1bd Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 30 Mar 1993 13:18:41 +0000 Subject: Changes to speed up local variables enormously, by avoiding dictionary lookup (opcode.h, ceval.[ch], compile.c, frameobject.[ch], pythonrun.c, import.c). The .pyc MAGIC number is changed again. Added get_menu_text to flmodule. --- Python/pythonrun.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index e59458e587..c387c62996 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -304,16 +304,23 @@ run_node(n, filename, globals, locals) char *filename; /*dict*/object *globals, *locals; { + object *res; + int needmerge = 0; if (globals == NULL) { globals = getglobals(); - if (locals == NULL) + if (locals == NULL) { locals = getlocals(); + needmerge = 1; + } } else { if (locals == NULL) locals = globals; } - return eval_node(n, filename, globals, locals); + res = eval_node(n, filename, globals, locals); + if (needmerge) + mergelocals(); + return res; } object * -- cgit v1.2.1