py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str.
This patch simplifies the str creation API to favour the common case of
creating a str object that is not forced to be interned. To force
interning of a new str the new mp_obj_new_str_via_qstr function is added,
and should only be used if warranted.
Apart from simplifying the mp_obj_new_str function (and making it have the
same signature as mp_obj_new_bytes), this patch also reduces code size by a
bit (-16 bytes for bare-arm and roughly -40 bytes on the bare-metal archs).
diff --git a/py/builtinhelp.c b/py/builtinhelp.c
index c999290..7106f3c 100644
--- a/py/builtinhelp.c
+++ b/py/builtinhelp.c
@@ -69,7 +69,7 @@
while (*name) {
size_t l = strlen(name);
// name should end in '.py' and we strip it off
- mp_obj_list_append(list, mp_obj_new_str(name, l - 3, false));
+ mp_obj_list_append(list, mp_obj_new_str(name, l - 3));
name += l + 1;
}
}