summaryrefslogtreecommitdiff
path: root/py/objint_longlong.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-04-05 01:11:26 +1000
committerDamien George <damien.p.george@gmail.com>2018-04-05 01:11:26 +1000
commitf1df86a0177c77769d73bc477570580b4f705acf (patch)
treea404d728c466239741dfca2550979a2ff0c1f896 /py/objint_longlong.c
parent5995a199a327b81553189d53035c586d7b0249dc (diff)
py/objint: Simplify LHS arg type checking in int binary op functions.
The LHS passed to mp_obj_int_binary_op() will always be an integer, either a small int or a big int, so the test for this type doesn't need to include an "other, unsupported type" case.
Diffstat (limited to 'py/objint_longlong.c')
-rw-r--r--py/objint_longlong.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/py/objint_longlong.c b/py/objint_longlong.c
index 3e5ebadaf..cb8d1672d 100644
--- a/py/objint_longlong.c
+++ b/py/objint_longlong.c
@@ -124,10 +124,9 @@ mp_obj_t mp_obj_int_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i
if (MP_OBJ_IS_SMALL_INT(lhs_in)) {
lhs_val = MP_OBJ_SMALL_INT_VALUE(lhs_in);
- } else if (MP_OBJ_IS_TYPE(lhs_in, &mp_type_int)) {
- lhs_val = ((mp_obj_int_t*)lhs_in)->val;
} else {
- return MP_OBJ_NULL; // op not supported
+ assert(MP_OBJ_IS_TYPE(lhs_in, &mp_type_int));
+ lhs_val = ((mp_obj_int_t*)lhs_in)->val;
}
if (MP_OBJ_IS_SMALL_INT(rhs_in)) {