From e233a55a296a981bce5fe3a7c20049bea46e3a16 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 11 Jan 2015 21:07:15 +0000 Subject: py: Remove unnecessary BINARY_OP_EQUAL code that just checks pointers. Previous patch c38dc3ccc76d1a9bf867704f43ea5d15da3fea7b allowed any object to be compared with any other, using pointer comparison for a fallback. As such, existing code which checked for this case is no longer needed. --- py/objstr.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'py/objstr.c') diff --git a/py/objstr.c b/py/objstr.c index 688988c01..01ed3a2d3 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -348,16 +348,12 @@ mp_obj_t mp_obj_str_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rhs_in) { } else if (lhs_type == &mp_type_bytes) { mp_buffer_info_t bufinfo; if (!mp_get_buffer(rhs_in, &bufinfo, MP_BUFFER_READ)) { - goto incompatible; + return MP_OBJ_NULL; // op not supported } rhs_data = bufinfo.buf; rhs_len = bufinfo.len; } else { // incompatible types - incompatible: - if (op == MP_BINARY_OP_EQUAL) { - return mp_const_false; // can check for equality against every type - } return MP_OBJ_NULL; // op not supported } -- cgit v1.2.3