summaryrefslogtreecommitdiffstats
path: root/Modules/clinic/zlibmodule.c.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-08-14 07:52:18 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-08-14 07:52:18 (GMT)
commit9171a8b4cea3e7b30e4f2c0a989d7f7b8ffabe73 (patch)
tree5cc9c9243ba4ef93902fafdc624e56eab3b15842 /Modules/clinic/zlibmodule.c.h
parentb6f78c2755489dfcbe4898072ef0cd7dca11ff3d (diff)
downloadcpython-9171a8b4cea3e7b30e4f2c0a989d7f7b8ffabe73.zip
cpython-9171a8b4cea3e7b30e4f2c0a989d7f7b8ffabe73.tar.gz
cpython-9171a8b4cea3e7b30e4f2c0a989d7f7b8ffabe73.tar.bz2
Issue #27574: Decreased an overhead of parsing keyword arguments in functions
implemented with using Argument Clinic.
Diffstat (limited to 'Modules/clinic/zlibmodule.c.h')
-rw-r--r--Modules/clinic/zlibmodule.c.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h
index 506d550..e4e2c0d 100644
--- a/Modules/clinic/zlibmodule.c.h
+++ b/Modules/clinic/zlibmodule.c.h
@@ -23,11 +23,12 @@ static PyObject *
zlib_compress(PyObject *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
- static char *_keywords[] = {"", "level", NULL};
+ static const char * const _keywords[] = {"", "level", NULL};
+ static _PyArg_Parser _parser = {"y*|i:compress", _keywords, 0};
Py_buffer data = {NULL, NULL};
int level = Z_DEFAULT_COMPRESSION;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:compress", _keywords,
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
&data, &level)) {
goto exit;
}
@@ -126,7 +127,8 @@ static PyObject *
zlib_compressobj(PyObject *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
- static char *_keywords[] = {"level", "method", "wbits", "memLevel", "strategy", "zdict", NULL};
+ static const char * const _keywords[] = {"level", "method", "wbits", "memLevel", "strategy", "zdict", NULL};
+ static _PyArg_Parser _parser = {"|iiiiiy*:compressobj", _keywords, 0};
int level = Z_DEFAULT_COMPRESSION;
int method = DEFLATED;
int wbits = MAX_WBITS;
@@ -134,7 +136,7 @@ zlib_compressobj(PyObject *module, PyObject *args, PyObject *kwargs)
int strategy = Z_DEFAULT_STRATEGY;
Py_buffer zdict = {NULL, NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iiiiiy*:compressobj", _keywords,
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
&level, &method, &wbits, &memLevel, &strategy, &zdict)) {
goto exit;
}
@@ -171,11 +173,12 @@ static PyObject *
zlib_decompressobj(PyObject *module, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
- static char *_keywords[] = {"wbits", "zdict", NULL};
+ static const char * const _keywords[] = {"wbits", "zdict", NULL};
+ static _PyArg_Parser _parser = {"|iO:decompressobj", _keywords, 0};
int wbits = MAX_WBITS;
PyObject *zdict = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iO:decompressobj", _keywords,
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
&wbits, &zdict)) {
goto exit;
}
@@ -460,4 +463,4 @@ exit:
#ifndef ZLIB_COMPRESS_COPY_METHODDEF
#define ZLIB_COMPRESS_COPY_METHODDEF
#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
-/*[clinic end generated code: output=9046866b1ac5de7e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1fed251c15a9bffa input=a9049054013a1b77]*/