diff options
Diffstat (limited to 'py/objstr.c')
-rw-r--r-- | py/objstr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/objstr.c b/py/objstr.c index 4e70b00812..6656090c84 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -1751,6 +1751,11 @@ mp_obj_t mp_obj_new_str(const char* data, uint len, bool make_qstr_if_not_alread } } +mp_obj_t mp_obj_str_intern(mp_obj_t str) { + GET_STR_DATA_LEN(str, data, len); + return MP_OBJ_NEW_QSTR(qstr_from_strn((const char*)data, len)); +} + mp_obj_t mp_obj_new_bytes(const byte* data, uint len) { return mp_obj_new_str_of_type(&mp_type_bytes, data, len); } |