Commit 8de270b4 authored by Damien George's avatar Damien George
Browse files

py/objbool: Make a slight simplification of bool constructor.

Reduces code size for some archs.
parent eca1408f
......@@ -56,12 +56,10 @@ STATIC mp_obj_t bool_make_new(const mp_obj_type_t *type_in, size_t n_args, size_
(void)type_in;
mp_arg_check_num(n_args, n_kw, 0, 1, false);
switch (n_args) {
case 0:
return mp_const_false;
case 1:
default: // must be 0 or 1
if (mp_obj_is_true(args[0])) { return mp_const_true; } else { return mp_const_false; }
if (n_args == 0) {
return mp_const_false;
} else {
return mp_obj_new_bool(mp_obj_is_true(args[0]));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment