summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorJun Wu <quark@lihdd.net>2019-05-04 20:29:43 -0700
committerDamien George <damien.p.george@gmail.com>2019-05-06 18:28:28 +1000
commit089c9b71d10bd66549858254cc10803cba45453a (patch)
treee1f28ec6f5630e76eba8f5789977ff69e584f1e7 /py/runtime.c
parent32ba679924b8f5c8a81cff905e6bd295c6bb4df8 (diff)
py: remove "if (0)" and "if (false)" branches.
Prior to this commit, building the unix port with `DEBUG=1` and `-finstrument-functions` the compilation would fail with an error like "control reaches end of non-void function". This change fixes this by removing the problematic "if (0)" branches. Not all branches affect compilation, but they are all removed for consistency.
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/py/runtime.c b/py/runtime.c
index a3628eecb..e50256605 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1049,14 +1049,13 @@ void mp_load_method_maybe(mp_obj_t obj, qstr attr, mp_obj_t *dest) {
mp_obj_type_t *type = mp_obj_get_type(obj);
// look for built-in names
- if (0) {
#if MICROPY_CPYTHON_COMPAT
- } else if (attr == MP_QSTR___class__) {
+ if (attr == MP_QSTR___class__) {
// a.__class__ is equivalent to type(a)
dest[0] = MP_OBJ_FROM_PTR(type);
+ } else
#endif
-
- } else if (attr == MP_QSTR___next__ && type->iternext != NULL) {
+ if (attr == MP_QSTR___next__ && type->iternext != NULL) {
dest[0] = MP_OBJ_FROM_PTR(&mp_builtin_next_obj);
dest[1] = obj;