Mercurial > cpython-lru_cache-weakref
comparison Modules/arraymodule.c @ 37756:7b2e436a4a21 legacy-trunk
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
| author | Thomas Wouters <thomas@python.org> |
|---|---|
| date | Sat, 15 Apr 2006 21:47:09 +0000 |
| parents | 4020cf6c383e |
| children | 12ab20cd7c27 |
comparison
equal
deleted
inserted
replaced
| 37755:b7373bc3b09f | 37756:7b2e436a4a21 |
|---|---|
| 2059 } | 2059 } |
| 2060 | 2060 |
| 2061 static int | 2061 static int |
| 2062 arrayiter_traverse(arrayiterobject *it, visitproc visit, void *arg) | 2062 arrayiter_traverse(arrayiterobject *it, visitproc visit, void *arg) |
| 2063 { | 2063 { |
| 2064 if (it->ao != NULL) | 2064 Py_VISIT(it->ao); |
| 2065 return visit((PyObject *)(it->ao), arg); | |
| 2066 return 0; | 2065 return 0; |
| 2067 } | 2066 } |
| 2068 | 2067 |
| 2069 static PyTypeObject PyArrayIter_Type = { | 2068 static PyTypeObject PyArrayIter_Type = { |
| 2070 PyObject_HEAD_INIT(NULL) | 2069 PyObject_HEAD_INIT(NULL) |
