summaryrefslogtreecommitdiffstats
path: root/Modules/zipimport.c
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-04-15 21:47:09 (GMT)
committerThomas Wouters <thomas@python.org>2006-04-15 21:47:09 (GMT)
commitc6e55068cad6f2178981eec4f0a0a583b8bba21a (patch)
tree19a89bbe082dadc70c1413030e5a5b8dacac757c /Modules/zipimport.c
parent447d095976fd532bf1882bf7afeb52473ff8673c (diff)
downloadcpython-c6e55068cad6f2178981eec4f0a0a583b8bba21a.zip
cpython-c6e55068cad6f2178981eec4f0a0a583b8bba21a.tar.gz
cpython-c6e55068cad6f2178981eec4f0a0a583b8bba21a.tar.bz2
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/zipimport.c')
-rw-r--r--Modules/zipimport.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 3e37656..d59ebd8 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -170,13 +170,7 @@ static int
zipimporter_traverse(PyObject *obj, visitproc visit, void *arg)
{
ZipImporter *self = (ZipImporter *)obj;
- int err;
-
- if (self->files != NULL) {
- err = visit(self->files, arg);
- if (err)
- return err;
- }
+ Py_VISIT(self->files);
return 0;
}