Freestyle: reserve array sizes before filling

also use PyList_GET_ITEM when list size is known.
This commit is contained in:
2015-01-04 21:20:45 +11:00
parent de6b546e15
commit b240b8e231
6 changed files with 21 additions and 14 deletions

View File

@@ -568,7 +568,7 @@ CValue *CValue::ConvertPythonToValue(PyObject *pyobj, const bool do_type_excepti
Py_ssize_t numitems = PyList_GET_SIZE(pyobj);
for (i=0;i<numitems;i++)
{
PyObject *listitem = PyList_GetItem(pyobj,i); /* borrowed ref */
PyObject *listitem = PyList_GET_ITEM(pyobj,i); /* borrowed ref */
CValue* listitemval = ConvertPythonToValue(listitem, error_prefix);
if (listitemval)
{