From 7db79d8b031e69392432ace687c9fcfdd2c56d4c Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 19 Dec 2017 14:01:19 +1100 Subject: [PATCH] py/objset: Remove unneeded check from set_equal. set_equal is called only from set_binary_op, and this guarantees that the second arg to set_equal is always a set or frozenset. So there is no need to do a further check. --- py/objset.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py/objset.c b/py/objset.c index 3e98c30e8f..799ba9df04 100644 --- a/py/objset.c +++ b/py/objset.c @@ -351,11 +351,9 @@ STATIC mp_obj_t set_issuperset_proper(mp_obj_t self_in, mp_obj_t other_in) { } STATIC mp_obj_t set_equal(mp_obj_t self_in, mp_obj_t other_in) { + assert(is_set_or_frozenset(other_in)); check_set_or_frozenset(self_in); mp_obj_set_t *self = MP_OBJ_TO_PTR(self_in); - if (!is_set_or_frozenset(other_in)) { - return mp_const_false; - } mp_obj_set_t *other = MP_OBJ_TO_PTR(other_in); if (self->set.used != other->set.used) { return mp_const_false;