From 3c7cab4e98a31649ed1bc2e728d610856382d6f5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 16 Mar 2022 00:22:58 +1100 Subject: 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 --- py/compile.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'py/compile.c') 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) { -- cgit v1.2.3