py: Un-nest configuration #if/#endif's for selection of complex code.

Because un-nested #if's are simpler to handle with formatting tools.
This commit is contained in:
Damien George 2020-02-27 12:35:44 +11:00
parent 7768a8c38d
commit 17aeb43e18
2 changed files with 2 additions and 2 deletions

View File

@ -184,10 +184,10 @@ mp_obj_t mp_obj_int_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i
#if MICROPY_PY_BUILTINS_FLOAT
} else if (mp_obj_is_float(rhs_in)) {
return mp_obj_float_binary_op(op, mpz_as_float(zlhs), rhs_in);
#endif
#if MICROPY_PY_BUILTINS_COMPLEX
} else if (mp_obj_is_type(rhs_in, &mp_type_complex)) {
return mp_obj_complex_binary_op(op, mpz_as_float(zlhs), 0, rhs_in);
#endif
#endif
} else {
// delegate to generic function to check for extra cases

View File

@ -527,6 +527,7 @@ mp_obj_t mp_binary_op(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs) {
} else {
return res;
}
#endif
#if MICROPY_PY_BUILTINS_COMPLEX
} else if (mp_obj_is_type(rhs, &mp_type_complex)) {
mp_obj_t res = mp_obj_complex_binary_op(op, lhs_val, 0, rhs);
@ -535,7 +536,6 @@ mp_obj_t mp_binary_op(mp_binary_op_t op, mp_obj_t lhs, mp_obj_t rhs) {
} else {
return res;
}
#endif
#endif
}
}