summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/_pickle.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/_pickle.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/_pickle.c.h')
-rw-r--r--Modules/clinic/_pickle.c.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h
index 3f6be4b..2759b2f2 100644
--- a/Modules/clinic/_pickle.c.h
+++ b/Modules/clinic/_pickle.c.h
@@ -213,11 +213,11 @@ _pickle_Unpickler_find_class(UnpicklerObject *self, PyObject *const *args, Py_ss
PyObject *module_name;
PyObject *global_name;
- if (!_PyArg_UnpackStack(args, nargs, "find_class",
- 2, 2,
- &module_name, &global_name)) {
+ if (!_PyArg_CheckPositional("find_class", nargs, 2, 2)) {
goto exit;
}
+ module_name = args[0];
+ global_name = args[1];
return_value = _pickle_Unpickler_find_class_impl(self, module_name, global_name);
exit:
@@ -562,4 +562,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
exit:
return return_value;
}
-/*[clinic end generated code: output=4b32d63ff58b64d8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=225f06abcf27ed2b input=a9049054013a1b77]*/