mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +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
@@ -328,7 +328,7 @@ mp_obj_t esp_ifname(esp_netif_t *netif) {
|
||||
char ifname[NETIF_NAMESIZE + 1] = {0};
|
||||
mp_obj_t ret = mp_const_none;
|
||||
if (esp_netif_get_netif_impl_name(netif, ifname) == ESP_OK && ifname[0] != 0) {
|
||||
ret = mp_obj_new_str((char *)ifname, strlen(ifname));
|
||||
ret = mp_obj_new_str_from_cstr((char *)ifname);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user