diff options
author | Guido van Rossum <guido@python.org> | 1997-01-27 23:42:36 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-01-27 23:42:36 (GMT) |
commit | deb0c5e66cffce69773a27b14456ec3c9413b592 (patch) | |
tree | 8cdd802a65a8320ef83bc61f4752aa1ac8356334 /Python | |
parent | 866016b92d9f041bf5c56cbf4b3ae436109913da (diff) | |
download | cpython-deb0c5e66cffce69773a27b14456ec3c9413b592.zip cpython-deb0c5e66cffce69773a27b14456ec3c9413b592.tar.gz cpython-deb0c5e66cffce69773a27b14456ec3c9413b592.tar.bz2 |
Two small changes:
- Use co->... instead of f->f_code->...; save an extra lookup of what
we already have in a local variable).
- Remove test for nlocals > 0 before setting fastlocals to
f->f_localsplus; 0 is a rare case and the assignment is safe even
then.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index a59a1c9..65aad61 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -356,7 +356,7 @@ eval_code2(co, globals, locals, #define GETCONST(i) Getconst(f, i) #define GETNAME(i) Getname(f, i) #define GETNAMEV(i) Getnamev(f, i) -#define FIRST_INSTR() (GETUSTRINGVALUE(f->f_code->co_code)) +#define FIRST_INSTR() (GETUSTRINGVALUE(co->co_code)) #define INSTR_OFFSET() (next_instr - FIRST_INSTR()) #define NEXTOP() (*next_instr++) #define NEXTARG() (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2]) @@ -410,9 +410,7 @@ eval_code2(co, globals, locals, return NULL; current_frame = f; - - if (co->co_nlocals > 0) - fastlocals = f->f_localsplus; + fastlocals = f->f_localsplus; if (co->co_argcount > 0 || co->co_flags & (CO_VARARGS | CO_VARKEYWORDS)) { @@ -544,7 +542,7 @@ eval_code2(co, globals, locals, return NULL; } - next_instr = GETUSTRINGVALUE(f->f_code->co_code); + next_instr = GETUSTRINGVALUE(co->co_code); stack_pointer = f->f_valuestack; why = WHY_NOT; |