From ff8e35b42ec9fbf2ab18d777a232b953ccd1f14c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 4 Jan 2015 13:23:44 +0200 Subject: [PATCH] objstr: Common subexpression elimination for vstr_str(field_name). --- py/objstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/objstr.c b/py/objstr.c index 8d05ae8c9f..688988c019 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -944,7 +944,7 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa "can't switch from automatic field numbering to manual field specification")); } } - lookup = str_to_int(vstr_str(field_name), &index) + field; + lookup = str_to_int(field, &index) + field; if (index >= n_args - 1) { nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, "tuple index out of range")); }