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 /Objects/dictobject.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 'Objects/dictobject.c')
| -rw-r--r-- | Objects/dictobject.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 31ef958e63..f5799ee09f 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1732,17 +1732,12 @@ static int dict_traverse(PyObject *op, visitproc visit, void *arg) { Py_ssize_t i = 0; - int err; PyObject *pk; PyObject *pv; while (PyDict_Next(op, &i, &pk, &pv)) { - err = visit(pk, arg); - if (err) - return err; - err = visit(pv, arg); - if (err) - return err; + Py_VISIT(pk); + Py_VISIT(pv); } return 0; } |
