mirror of
https://github.com/python/cpython.git
synced 2025-09-19 15:10:58 +00:00
bpo-40898: Remove redundant if statements in tp_traverse (GH-20692)
This commit is contained in:
parent
b8867e5d5a
commit
47a23fc63f
4 changed files with 5 additions and 13 deletions
|
@ -484,7 +484,6 @@ static int
|
||||||
keyobject_traverse(keyobject *ko, visitproc visit, void *arg)
|
keyobject_traverse(keyobject *ko, visitproc visit, void *arg)
|
||||||
{
|
{
|
||||||
Py_VISIT(ko->cmp);
|
Py_VISIT(ko->cmp);
|
||||||
if (ko->object)
|
|
||||||
Py_VISIT(ko->object);
|
Py_VISIT(ko->object);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -623,9 +623,7 @@ iomodule_traverse(PyObject *mod, visitproc visit, void *arg) {
|
||||||
_PyIO_State *state = get_io_state(mod);
|
_PyIO_State *state = get_io_state(mod);
|
||||||
if (!state->initialized)
|
if (!state->initialized)
|
||||||
return 0;
|
return 0;
|
||||||
if (state->locale_module != NULL) {
|
|
||||||
Py_VISIT(state->locale_module);
|
Py_VISIT(state->locale_module);
|
||||||
}
|
|
||||||
Py_VISIT(state->unsupported_operation);
|
Py_VISIT(state->unsupported_operation);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -999,7 +999,6 @@ cycle_dealloc(cycleobject *lz)
|
||||||
static int
|
static int
|
||||||
cycle_traverse(cycleobject *lz, visitproc visit, void *arg)
|
cycle_traverse(cycleobject *lz, visitproc visit, void *arg)
|
||||||
{
|
{
|
||||||
if (lz->it)
|
|
||||||
Py_VISIT(lz->it);
|
Py_VISIT(lz->it);
|
||||||
Py_VISIT(lz->saved);
|
Py_VISIT(lz->saved);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1504,13 +1504,9 @@ Overlapped_traverse(OverlappedObject *self, visitproc visit, void *arg)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TYPE_READ_FROM:
|
case TYPE_READ_FROM:
|
||||||
if(self->read_from.result) {
|
|
||||||
Py_VISIT(self->read_from.result);
|
Py_VISIT(self->read_from.result);
|
||||||
}
|
|
||||||
if(self->read_from.allocated_buffer) {
|
|
||||||
Py_VISIT(self->read_from.allocated_buffer);
|
Py_VISIT(self->read_from.allocated_buffer);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue