Skip to content

Commit 7db79d8

Browse files
committed
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.
1 parent 7208cad commit 7db79d8

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

py/objset.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,9 @@ STATIC mp_obj_t set_issuperset_proper(mp_obj_t self_in, mp_obj_t other_in) {
351351
}
352352

353353
STATIC mp_obj_t set_equal(mp_obj_t self_in, mp_obj_t other_in) {
354+
assert(is_set_or_frozenset(other_in));
354355
check_set_or_frozenset(self_in);
355356
mp_obj_set_t *self = MP_OBJ_TO_PTR(self_in);
356-
if (!is_set_or_frozenset(other_in)) {
357-
return mp_const_false;
358-
}
359357
mp_obj_set_t *other = MP_OBJ_TO_PTR(other_in);
360358
if (self->set.used != other->set.used) {
361359
return mp_const_false;

0 commit comments

Comments
 (0)