py/argcheck: Simplify if-chain so that the last one is the default.

This commit is contained in:
Damien George 2016-09-30 16:45:43 +10:00
parent 9f72a14920
commit 3be4f886ce
1 changed files with 2 additions and 3 deletions

View File

@ -105,10 +105,9 @@ void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, size_t n
out_vals[i].u_bool = mp_obj_is_true(given_arg);
} else if ((allowed[i].flags & MP_ARG_KIND_MASK) == MP_ARG_INT) {
out_vals[i].u_int = mp_obj_get_int(given_arg);
} else if ((allowed[i].flags & MP_ARG_KIND_MASK) == MP_ARG_OBJ) {
out_vals[i].u_obj = given_arg;
} else {
assert(0);
assert((allowed[i].flags & MP_ARG_KIND_MASK) == MP_ARG_OBJ);
out_vals[i].u_obj = given_arg;
}
}
if (pos_found < n_pos) {