summaryrefslogtreecommitdiffstats
path: root/Objects/weakrefobject.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 /Objects/weakrefobject.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 'Objects/weakrefobject.c')
-rw-r--r--Objects/weakrefobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index a116efc..a8ab56e 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -109,8 +109,7 @@ weakref_dealloc(PyObject *self)
static int
gc_traverse(PyWeakReference *self, visitproc visit, void *arg)
{
- if (self->wr_callback != NULL)
- return visit(self->wr_callback, arg);
+ Py_VISIT(self->wr_callback);
return 0;
}