summaryrefslogtreecommitdiff
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-04-15 21:47:09 +0000
committerThomas Wouters <thomas@python.org>2006-04-15 21:47:09 +0000
commitc6e55068cad6f2178981eec4f0a0a583b8bba21a (patch)
tree19a89bbe082dadc70c1413030e5a5b8dacac757c /Python/traceback.c
parent447d095976fd532bf1882bf7afeb52473ff8673c (diff)
downloadcpython-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 'Python/traceback.c')
-rw-r--r--Python/traceback.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index cdbec2b470..cfbd83361f 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -39,15 +39,9 @@ tb_dealloc(PyTracebackObject *tb)
static int
tb_traverse(PyTracebackObject *tb, visitproc visit, void *arg)
{
- int err = 0;
- if (tb->tb_next) {
- err = visit((PyObject *)tb->tb_next, arg);
- if (err)
- return err;
- }
- if (tb->tb_frame)
- err = visit((PyObject *)tb->tb_frame, arg);
- return err;
+ Py_VISIT(tb->tb_next);
+ Py_VISIT(tb->tb_frame);
+ return 0;
}
static void