diff options
author | Thomas Wouters <thomas@python.org> | 2006-04-15 21:47:09 +0000 |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-04-15 21:47:09 +0000 |
commit | c6e55068cad6f2178981eec4f0a0a583b8bba21a (patch) | |
tree | 19a89bbe082dadc70c1413030e5a5b8dacac757c /Modules/arraymodule.c | |
parent | 447d095976fd532bf1882bf7afeb52473ff8673c (diff) | |
download | cpython-git-c6e55068cad6f2178981eec4f0a0a583b8bba21a.tar.gz |
Use Py_VISIT in all tp_traverse methods, instead of traversing manually or
using a custom, nearly-identical macro. This probably changes how some of
these functions are compiled, which may result in fractionally slower (or
faster) execution. Considering the nature of traversal, visiting much of the
address space in unpredictable patterns, I'd argue the code readability and
maintainability is well worth it ;P
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r-- | Modules/arraymodule.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 4324f39f84..4551342f45 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -2061,8 +2061,7 @@ arrayiter_dealloc(arrayiterobject *it) static int arrayiter_traverse(arrayiterobject *it, visitproc visit, void *arg) { - if (it->ao != NULL) - return visit((PyObject *)(it->ao), arg); + Py_VISIT(it->ao); return 0; } |