diff options
author | Damien George <damien.p.george@gmail.com> | 2016-09-30 12:34:05 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-09-30 12:34:05 +1000 |
commit | 3dea8c9e926d0c1b1049ff9d5abeedfb001fc201 (patch) | |
tree | f99592adff2bf9563e214e0f985d83e3d1226a61 /py/compile.c | |
parent | 6ab2c5e6cc6359c3419a9d8ee61b4e586864d048 (diff) |
py/scope: Use lookup-table to determine a scope's simple name.
Generates slightly smaller and more efficient code.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/compile.c b/py/compile.c index 3039f98b5..2253ccd3f 100644 --- a/py/compile.c +++ b/py/compile.c @@ -3288,7 +3288,7 @@ STATIC void scope_compute_things(scope_t *scope) { // __class__ is not counted as a local; if it's used then it becomes a ID_INFO_KIND_CELL continue; } - if (scope->kind >= SCOPE_FUNCTION && scope->kind <= SCOPE_GEN_EXPR && id->kind == ID_INFO_KIND_GLOBAL_IMPLICIT) { + if (SCOPE_IS_FUNC_LIKE(scope->kind) && id->kind == ID_INFO_KIND_GLOBAL_IMPLICIT) { id->kind = ID_INFO_KIND_GLOBAL_EXPLICIT; } // params always count for 1 local, even if they are a cell |