diff options
author | Damien George <damien.p.george@gmail.com> | 2017-12-19 14:01:19 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-12-19 14:01:19 +1100 |
commit | 7db79d8b031e69392432ace687c9fcfdd2c56d4c (patch) | |
tree | 6a4de1fb8c974b375c7d28abbea9a8cde95151ae /py/objset.c | |
parent | 7208cad97afb4f65902f7943ace425f652eeb669 (diff) |
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.
Diffstat (limited to 'py/objset.c')
-rw-r--r-- | py/objset.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/py/objset.c b/py/objset.c index 3e98c30e8..799ba9df0 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; |