diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-04 13:20:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-04 13:23:26 +0300 |
commit | b240b8e23115fe99f47ee5b3fd66fd3796ff8a1b (patch) | |
tree | 21b3fe18c223d3453ac12ff1de5aa0083e3e8458 /source/gameengine/Expressions | |
parent | de6b546e15523a0a4ab6da7e5beebaeb15cfa617 (diff) |
Freestyle: reserve array sizes before filling
also use PyList_GET_ITEM when list size is known.
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r-- | source/gameengine/Expressions/ListValue.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Expressions/Value.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 75e3b490505..5e0eb92eb58 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -432,7 +432,7 @@ static PyObject *listvalue_buffer_concat(PyObject *self, PyObject *other) for (i=0;i<numitems;i++) { - listitemval = listval->ConvertPythonToValue(PyList_GetItem(other,i), true, "cList + pyList: CListValue, "); + listitemval = listval->ConvertPythonToValue(PyList_GET_ITEM(other, i), true, "cList + pyList: CListValue, "); if (listitemval) { listval_new->SetValue(i+numitems_orig, listitemval); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index bdef2dbd5b0..286db016476 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -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) { |