Commit ff8e35b4 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

objstr: Common subexpression elimination for vstr_str(field_name).

parent c1144966
......@@ -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"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment