summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-09-30 16:45:43 +1000
committerDamien George <damien.p.george@gmail.com>2016-09-30 16:45:43 +1000
commit3be4f886ce2ab5bd625e0d7ad29ba827844df749 (patch)
treeb3ec8dfe7ed728dbd12dede6bed857d31ae34b82 /py
parent9f72a14920dbb99a66f7b81f27d2d45a3a33f44e (diff)
downloadmicropython-3be4f886ce2ab5bd625e0d7ad29ba827844df749.tar.gz
micropython-3be4f886ce2ab5bd625e0d7ad29ba827844df749.zip
py/argcheck: Simplify if-chain so that the last one is the default.
Diffstat (limited to 'py')
-rw-r--r--py/argcheck.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/py/argcheck.c b/py/argcheck.c
index 5733c77f1d..a6c769ee82 100644
--- a/py/argcheck.c
+++ b/py/argcheck.c
@@ -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) {