py: Add "default" to switches to allow better code flow analysis.

This helps compiler produce smaller code.  Saves 124 bytes on stmhal and
bare-arm.
This commit is contained in:
Damien George
2015-01-14 21:32:42 +00:00
parent 65ef6b768c
commit d2d64f00fb
7 changed files with 19 additions and 26 deletions

View File

@@ -83,11 +83,8 @@ STATIC mp_obj_t fun_builtin_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n
return ((mp_fun_2_t)self->fun)(args[0], args[1]);
case 3:
return ((mp_fun_3_t)self->fun)(args[0], args[1], args[2]);
default:
assert(0);
return mp_const_none;
return ((mp_fun_3_t)self->fun)(args[0], args[1], args[2]);
}
} else {