Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.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 | a6fb6822814a |
| children | 651fc8d98d99 |
line wrap: on
line diff
--- a/Modules/socketmodule.c Sun Oct 12 18:24:34 2003 +0000 +++ b/Modules/socketmodule.c Sun Oct 12 19:09:37 2003 +0000 @@ -1161,7 +1161,7 @@ if (addr == NULL) goto finally; - res = Py_BuildValue("OO", sock, addr); + res = PyTuple_Pack(2, sock, addr); finally: Py_XDECREF(sock); @@ -1911,7 +1911,7 @@ addrlen))) goto finally; - ret = Py_BuildValue("OO", buf, addr); + ret = PyTuple_Pack(2, buf, addr); finally: Py_XDECREF(addr);
