From 40f5c743db7f16a0b898fe1697c626e53aa6500d Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 1 Apr 2022 00:21:03 +1100 Subject: [PATCH] py/runtime: Remove unnecessary check for kw_value == MP_OBJ_NULL. The values are always real objects, only the key can be MP_OBJ_NULL to indicate a **kwargs entry. Signed-off-by: Damien George --- py/runtime.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py/runtime.c b/py/runtime.c index ad066acb16..2a07df6642 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -828,9 +828,7 @@ void mp_call_prepare_args_n_kw_var(bool have_self, size_t n_args_n_kw, const mp_ mp_obj_t kw_value = args[n_args + i * 2 + 1]; if (kw_key == MP_OBJ_NULL) { // double-star args - if (kw_value == MP_OBJ_NULL) { - // pass - } else if (mp_obj_is_type(kw_value, &mp_type_dict)) { + if (mp_obj_is_type(kw_value, &mp_type_dict)) { // dictionary mp_map_t *map = mp_obj_dict_get_map(kw_value); // should have enough, since kw_dict_len is in this case hinted correctly above