summaryrefslogtreecommitdiffstats
path: root/Objects/iterobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/iterobject.c')
-rw-r--r--Objects/iterobject.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index 14cacc6..cf839f4 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -38,9 +38,8 @@ iter_dealloc(seqiterobject *it)
static int
iter_traverse(seqiterobject *it, visitproc visit, void *arg)
{
- if (it->it_seq == NULL)
- return 0;
- return visit(it->it_seq, arg);
+ Py_VISIT(it->it_seq);
+ return 0;
}
static PyObject *
@@ -162,11 +161,8 @@ calliter_dealloc(calliterobject *it)
static int
calliter_traverse(calliterobject *it, visitproc visit, void *arg)
{
- int err;
- if (it->it_callable != NULL && (err = visit(it->it_callable, arg)))
- return err;
- if (it->it_sentinel != NULL && (err = visit(it->it_sentinel, arg)))
- return err;
+ Py_VISIT(it->it_callable);
+ Py_VISIT(it->it_sentinel);
return 0;
}