Skip to content

Commit

Permalink
Address code review
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Apr 20, 2024
1 parent 50d62bd commit 9cca889
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Objects/setobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,8 @@ set_init(PySetObject *self, PyObject *args, PyObject *kwds)
if (!PyArg_UnpackTuple(args, Py_TYPE(self)->tp_name, 0, 1, &iterable))
return -1;

if (self->fill == 0 && Py_REFCNT(self) == 1) {
if (Py_REFCNT(self) == 1 && self->fill == 0) {
self->hash = -1;
if (iterable == NULL) {
return 0;
}
Expand Down

0 comments on commit 9cca889

Please sign in to comment.