summaryrefslogtreecommitdiffstatshomepage
path: root/py/objstr.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-11 21:07:15 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-11 21:07:15 +0000
commite233a55a296a981bce5fe3a7c20049bea46e3a16 (patch)
tree0df8fbe6242485d59dbf5621976ba209005a49c0 /py/objstr.c
parentc38dc3ccc76d1a9bf867704f43ea5d15da3fea7b (diff)
downloadmicropython-e233a55a296a981bce5fe3a7c20049bea46e3a16.tar.gz
micropython-e233a55a296a981bce5fe3a7c20049bea46e3a16.zip
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.
Diffstat (limited to 'py/objstr.c')
-rw-r--r--py/objstr.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 688988c019..01ed3a2d3b 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
}