diff options
author | mano-wii <germano.costa@ig.com.br> | 2018-09-27 06:22:57 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2018-09-27 06:22:57 +0300 |
commit | 1e647a570d9c42de915bc1204ff21ea5fa4e6b17 (patch) | |
tree | 3d67b4865447bc8592bf8f39bfed5e7808defbc9 /source/blender/python/gpu/gpu_py_vertex_format.c | |
parent | d559eaffd46e3a0e4e289e7307fabd79a4a29a11 (diff) |
Python GPU module: replace `PyArg_ParseTupleAndKeywords` by `_PyArg_ParseTupleAndKeywordsFast`
part of T47811 ("for faster argument parsing").
Diffstat (limited to 'source/blender/python/gpu/gpu_py_vertex_format.c')
-rw-r--r-- | source/blender/python/gpu/gpu_py_vertex_format.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/gpu/gpu_py_vertex_format.c b/source/blender/python/gpu/gpu_py_vertex_format.c index 96ca4003dc9..34f6af75477 100644 --- a/source/blender/python/gpu/gpu_py_vertex_format.c +++ b/source/blender/python/gpu/gpu_py_vertex_format.c @@ -154,8 +154,6 @@ PyDoc_STRVAR(bpygpu_VertFormat_attr_add_doc, ); static PyObject *bpygpu_VertFormat_attr_add(BPyGPUVertFormat *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"id", "comp_type", "len", "fetch_mode", NULL}; - struct { const char *id; GPUVertCompType comp_type; @@ -168,8 +166,10 @@ static PyObject *bpygpu_VertFormat_attr_add(BPyGPUVertFormat *self, PyObject *ar return NULL; } - if (!PyArg_ParseTupleAndKeywords( - args, kwds, "$sO&IO&:attr_add", (char **)kwlist, + static const char *_keywords[] = {"id", "comp_type", "len", "fetch_mode", NULL}; + static _PyArg_Parser _parser = {"$sO&IO&:attr_add", _keywords, 0}; + if (!_PyArg_ParseTupleAndKeywordsFast( + args, kwds, &_parser, ¶ms.id, bpygpu_ParseVertCompType, ¶ms.comp_type, ¶ms.len, |