use PyList_SET_ITEM instead of PyList_SetItem,

PyList_SetItem does error checking and decref's existing values, PyList_SET_ITEM is a macro for direct assignment, only for use on new lists.
This commit is contained in:
2009-04-20 23:27:53 +00:00
parent 217bbb7800
commit 720f7a8b69
7 changed files with 61 additions and 61 deletions

View File

@@ -216,13 +216,13 @@ static PyObject* gPyGetSpectrum(PyObject*)
for (int index = 0; index < 512; index++)
{
PyList_SetItem(resultlist, index, PyFloat_FromDouble(spectrum[index]));
PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(spectrum[index]));
}
}
else {
for (int index = 0; index < 512; index++)
{
PyList_SetItem(resultlist, index, PyFloat_FromDouble(0.0));
PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(0.0));
}
}