Mercurial > cpython-lru_cache-weakref
diff Modules/arraymodule.c @ 30683:3b59fa5d25b1 legacy-trunk
Simplify and speedup uses of Py_BuildValue():
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c)
* Py_BuildValue("()",a) --> PyTuple_New(0)
* Py_BuildValue("O", a) --> Py_INCREF(a)
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Sun, 12 Oct 2003 19:09:37 +0000 |
| parents | ae0242e3459e |
| children | 35cb8114b45c |
line wrap: on
line diff
--- a/Modules/arraymodule.c Sun Oct 12 18:24:34 2003 +0000 +++ b/Modules/arraymodule.c Sun Oct 12 19:09:37 2003 +0000 @@ -1770,7 +1770,7 @@ Py_DECREF(v); } } else if (initial != NULL && PyString_Check(initial)) { - PyObject *t_initial = Py_BuildValue("(O)", + PyObject *t_initial = PyTuple_Pack(1, initial); PyObject *v = array_fromstring((arrayobject *)a,
