diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-14 21:32:42 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-14 21:32:42 +0000 |
commit | d2d64f00fb7f1487c1fa21a456e003a801d7e711 (patch) | |
tree | 7345a9ba92baed508c4287bfca5ab09d67290821 /py/objdict.c | |
parent | 65ef6b768cbba6a55f28c13433c3763c6567045e (diff) | |
download | micropython-d2d64f00fb7f1487c1fa21a456e003a801d7e711.tar.gz micropython-d2d64f00fb7f1487c1fa21a456e003a801d7e711.zip |
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.
Diffstat (limited to 'py/objdict.c')
-rw-r--r-- | py/objdict.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/py/objdict.c b/py/objdict.c index 63b3cfb329..900ecf4eb2 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -415,7 +415,7 @@ STATIC mp_obj_t dict_view_it_iternext(mp_obj_t self_in) { } else { switch (self->kind) { case MP_DICT_VIEW_ITEMS: - { + default: { mp_obj_t items[] = {next->key, next->value}; return mp_obj_new_tuple(2, items); } @@ -423,9 +423,6 @@ STATIC mp_obj_t dict_view_it_iternext(mp_obj_t self_in) { return next->key; case MP_DICT_VIEW_VALUES: return next->value; - default: - assert(0); /* can't happen */ - return mp_const_none; } } } |