mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
all: Use new mp_obj_new_str_from_cstr() function.
Use new function mp_obj_new_str_from_cstr() where appropriate. It simplifies the code, and makes it smaller too. Signed-off-by: Jon Foster <jon@jon-foster.co.uk>
This commit is contained in:
committed by
Damien George
parent
289b2dd879
commit
92484d8822
@@ -156,7 +156,7 @@ static mp_obj_t esp32_partition_info(mp_obj_t self_in) {
|
||||
MP_OBJ_NEW_SMALL_INT(self->part->subtype),
|
||||
mp_obj_new_int_from_uint(self->part->address),
|
||||
mp_obj_new_int_from_uint(self->part->size),
|
||||
mp_obj_new_str(&self->part->label[0], strlen(&self->part->label[0])),
|
||||
mp_obj_new_str_from_cstr(&self->part->label[0]),
|
||||
mp_obj_new_bool(self->part->encrypted),
|
||||
};
|
||||
return mp_obj_new_tuple(6, tuple);
|
||||
|
||||
Reference in New Issue
Block a user