mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF patch #659536: Use PyArg_UnpackTuple where possible.
Obtain cleaner coding and a system wide performance boost by using the fast, pre-parsed PyArg_Unpack function instead of PyArg_ParseTuple function which is driven by a format string.
This commit is contained in:
parent
f8bcfb13f1
commit
ea3fdf44a2
11 changed files with 41 additions and 41 deletions
|
@ -254,7 +254,7 @@ math_log(PyObject *self, PyObject *args)
|
|||
PyObject *ans;
|
||||
PyObject *newargs;
|
||||
|
||||
if (! PyArg_ParseTuple(args, "O|O:log", &arg, &base))
|
||||
if (!PyArg_UnpackTuple(args, "log", 1, 2, &arg, &base))
|
||||
return NULL;
|
||||
if (base == NULL)
|
||||
return loghelper(args, log, "d:log", arg);
|
||||
|
@ -298,7 +298,7 @@ math_log10(PyObject *self, PyObject *args)
|
|||
{
|
||||
PyObject *arg;
|
||||
|
||||
if (! PyArg_ParseTuple(args, "O:log10", &arg))
|
||||
if (!PyArg_UnpackTuple(args, "log10", 1, 1, &arg))
|
||||
return NULL;
|
||||
return loghelper(args, log10, "d:log10", arg);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue