summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs
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/cjkcodecs
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/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/clinic/multibytecodec.c.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h
index 0d8a3e0..c9c58cd 100644
--- a/Modules/cjkcodecs/clinic/multibytecodec.c.h
+++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h
@@ -25,11 +25,12 @@ static PyObject *
_multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
- static char *_keywords[] = {"input", "errors", NULL};
+ static const char * const _keywords[] = {"input", "errors", NULL};
+ static _PyArg_Parser _parser = {"O|z:encode", _keywords, 0};
PyObject *input;
const char *errors = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|z:encode", _keywords,
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
&input, &errors)) {
goto exit;
}
@@ -62,11 +63,12 @@ static PyObject *
_multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
- static char *_keywords[] = {"input", "errors", NULL};
+ static const char * const _keywords[] = {"input", "errors", NULL};
+ static _PyArg_Parser _parser = {"y*|z:decode", _keywords, 0};
Py_buffer input = {NULL, NULL};
const char *errors = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|z:decode", _keywords,
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
&input, &errors)) {
goto exit;
}
@@ -98,11 +100,12 @@ static PyObject *
_multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
- static char *_keywords[] = {"input", "final", NULL};
+ static const char * const _keywords[] = {"input", "final", NULL};
+ static _PyArg_Parser _parser = {"O|i:encode", _keywords, 0};
PyObject *input;
int final = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:encode", _keywords,
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
&input, &final)) {
goto exit;
}
@@ -146,11 +149,12 @@ static PyObject *
_multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject *self, PyObject *args, PyObject *kwargs)
{
PyObject *return_value = NULL;
- static char *_keywords[] = {"input", "final", NULL};
+ static const char * const _keywords[] = {"input", "final", NULL};
+ static _PyArg_Parser _parser = {"y*|i:decode", _keywords, 0};
Py_buffer input = {NULL, NULL};
int final = 0;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:decode", _keywords,
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
&input, &final)) {
goto exit;
}
@@ -326,4 +330,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
{"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
-/*[clinic end generated code: output=f837bc56b2fa2a4e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8e86fa162c85230b input=a9049054013a1b77]*/