summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/mathmodule.c.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-01-11 16:01:42 (GMT)
committerGitHub <noreply@github.com>2019-01-11 16:01:42 (GMT)
commit2a39d251f07d4c620e3b9a1848e3d1eb3067be64 (patch)
tree23c1e8e63e57945fab6127d31800b7578795e14b /Modules/clinic/mathmodule.c.h
parent4fa9591025b6a098f3d6402e5413ee6740ede6c5 (diff)
downloadcpython-2a39d251f07d4c620e3b9a1848e3d1eb3067be64.zip
cpython-2a39d251f07d4c620e3b9a1848e3d1eb3067be64.tar.gz
cpython-2a39d251f07d4c620e3b9a1848e3d1eb3067be64.tar.bz2
bpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)
Use _PyArg_CheckPositional() and inlined code instead of PyArg_UnpackTuple() and _PyArg_UnpackStack() if all parameters are positional and use the "object" converter.
Diffstat (limited to 'Modules/clinic/mathmodule.c.h')
-rw-r--r--Modules/clinic/mathmodule.c.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h
index 1165789..1c8fc2f 100644
--- a/Modules/clinic/mathmodule.c.h
+++ b/Modules/clinic/mathmodule.c.h
@@ -21,11 +21,11 @@ math_gcd(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
PyObject *a;
PyObject *b;
- if (!_PyArg_UnpackStack(args, nargs, "gcd",
- 2, 2,
- &a, &b)) {
+ if (!_PyArg_CheckPositional("gcd", nargs, 2, 2)) {
goto exit;
}
+ a = args[0];
+ b = args[1];
return_value = math_gcd_impl(module, a, b);
exit:
@@ -307,11 +307,11 @@ math_dist(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
PyObject *p;
PyObject *q;
- if (!_PyArg_UnpackStack(args, nargs, "dist",
- 2, 2,
- &p, &q)) {
+ if (!_PyArg_CheckPositional("dist", nargs, 2, 2)) {
goto exit;
}
+ p = args[0];
+ q = args[1];
return_value = math_dist_impl(module, p, q);
exit:
@@ -548,4 +548,4 @@ math_isclose(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
exit:
return return_value;
}
-/*[clinic end generated code: output=2fe4fecd85585313 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f3264ab0ef57ba0a input=a9049054013a1b77]*/