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_buffer.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_buffer.c')
-rw-r--r-- | source/blender/python/gpu/gpu_py_vertex_buffer.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/python/gpu/gpu_py_vertex_buffer.c b/source/blender/python/gpu/gpu_py_vertex_buffer.c index 1b8a257425b..53fbbf623fa 100644 --- a/source/blender/python/gpu/gpu_py_vertex_buffer.c +++ b/source/blender/python/gpu/gpu_py_vertex_buffer.c @@ -213,16 +213,15 @@ static int bpygpu_find_id(const GPUVertFormat *fmt, const char *id) static PyObject *bpygpu_VertBuf_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) { - const char * const keywords[] = {"len", "format", NULL}; - struct { BPyGPUVertFormat *py_fmt; uint len; } params; - if (!PyArg_ParseTupleAndKeywords( - args, kwds, - "$IO!:GPUVertBuf.__new__", (char **)keywords, + static const char *_keywords[] = {"len", "format", NULL}; + static _PyArg_Parser _parser = {"$IO!:GPUVertBuf.__new__", _keywords, 0}; + if (!_PyArg_ParseTupleAndKeywordsFast( + args, kwds, &_parser, ¶ms.len, &BPyGPUVertFormat_Type, ¶ms.py_fmt)) { @@ -241,15 +240,15 @@ PyDoc_STRVAR(bpygpu_VertBuf_fill_doc, ); static PyObject *bpygpu_VertBuf_fill(BPyGPUVertBuf *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"id", "data", NULL}; - struct { uint id; PyObject *py_seq_data; } params; - if (!PyArg_ParseTupleAndKeywords( - args, kwds, "$IO:fill", (char **)kwlist, + static const char *_keywords[] = {"id", "data", NULL}; + static _PyArg_Parser _parser = {"$IO:fill", _keywords, 0}; + if (!_PyArg_ParseTupleAndKeywordsFast( + args, kwds, &_parser, ¶ms.id, ¶ms.py_seq_data)) { |