Skip to content

Commit

Permalink
all: Use compile-time qstr when possible.
Browse files Browse the repository at this point in the history
For consistency qstr_from_str should be used for strings
known at runtime only.
  • Loading branch information
stinos committed Jan 12, 2021
1 parent f7aafc0 commit f72e73f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/utils/pyexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ int pyexec_friendly_repl(void) {

#if defined(USE_HOST_MODE) && MICROPY_HW_HAS_LCD
// in host mode, we enable the LCD for the repl
mp_obj_t lcd_o = mp_call_function_0(mp_load_name(qstr_from_str("LCD")));
mp_call_function_1(mp_load_attr(lcd_o, qstr_from_str("light")), mp_const_true);
mp_obj_t lcd_o = mp_call_function_0(mp_load_name(MP_QSTR_LCD));
mp_call_function_1(mp_load_attr(lcd_o, MP_QSTR_light), mp_const_true);
#endif

friendly_repl_reset:
Expand Down
4 changes: 2 additions & 2 deletions ports/unix/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ MP_NOINLINE int main_(int argc, char **argv) {
{
MP_DECLARE_CONST_FUN_OBJ_0(extra_coverage_obj);
MP_DECLARE_CONST_FUN_OBJ_0(extra_cpp_coverage_obj);
mp_store_global(QSTR_FROM_STR_STATIC("extra_coverage"), MP_OBJ_FROM_PTR(&extra_coverage_obj));
mp_store_global(QSTR_FROM_STR_STATIC("extra_cpp_coverage"), MP_OBJ_FROM_PTR(&extra_cpp_coverage_obj));
mp_store_global(MP_QSTR_extra_coverage, MP_OBJ_FROM_PTR(&extra_coverage_obj));
mp_store_global(MP_QSTR_extra_cpp_coverage, MP_OBJ_FROM_PTR(&extra_cpp_coverage_obj));
}
#endif

Expand Down

0 comments on commit f72e73f

Please sign in to comment.