diff options
author | Raymond Hettinger <python@rcn.com> | 2002-12-29 16:33:45 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-12-29 16:33:45 +0000 |
commit | e16c55928dff37e7c82ae7f16d4b92853bea57ad (patch) | |
tree | afa001f819c21218ae9c3677069c8abd17e5a556 /Modules/mathmodule.c | |
parent | 6e97777c5512e6bcde15272416f0a4d515427df1 (diff) | |
download | cpython-e16c55928dff37e7c82ae7f16d4b92853bea57ad.tar.gz |
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.
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r-- | Modules/mathmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 25728864ff..44c6abbd53 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -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); } |