diff options
| author | Damien George <damien@micropython.org> | 2022-03-16 00:22:58 +1100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-03-16 00:41:10 +1100 |
| commit | 3c7cab4e98a31649ed1bc2e728d610856382d6f5 (patch) | |
| tree | 2dd27b29992d82998a9853af8f356b8c258bf1f0 /py/compile.c | |
| parent | 65851ebb5126d4940e91c9f2c1d13b4e10753579 (diff) | |
py/parse: Put const bytes objects in parse tree as const object.
Instead of as an intermediate qstr, which may unnecessarily intern the data
of the bytes object.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/compile.c')
| -rw-r--r-- | py/compile.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/py/compile.c b/py/compile.c index 92736e22e..f9e8de457 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2816,16 +2816,6 @@ STATIC void compile_node(compiler_t *comp, mp_parse_node_t pn) { case MP_PARSE_NODE_STRING: EMIT_ARG(load_const_str, arg); break; - case MP_PARSE_NODE_BYTES: - // only create and load the actual bytes object on the last pass - if (comp->pass != MP_PASS_EMIT) { - EMIT_ARG(load_const_obj, mp_const_none); - } else { - size_t len; - const byte *data = qstr_data(arg, &len); - EMIT_ARG(load_const_obj, mp_obj_new_bytes(data, len)); - } - break; case MP_PARSE_NODE_TOKEN: default: if (arg == MP_TOKEN_NEWLINE) { |
