Skip to content

Commit

Permalink
py/runtime: Remove unnecessary check for kw_value == MP_OBJ_NULL.
Browse files Browse the repository at this point in the history
The values are always real objects, only the key can be MP_OBJ_NULL to
indicate a **kwargs entry.

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Mar 31, 2022
1 parent bd556b6 commit 40f5c74
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions py/runtime.c
Expand Up @@ -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
Expand Down

0 comments on commit 40f5c74

Please sign in to comment.