PyAPI: avoid redundant PyLong_AsLong call
Assigning to an RNA array converted from Python to C twice.
This commit is contained in:
@@ -2712,7 +2712,7 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject
|
|||||||
Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
|
Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
|
||||||
if (i == -1 && PyErr_Occurred())
|
if (i == -1 && PyErr_Occurred())
|
||||||
return NULL;
|
return NULL;
|
||||||
return pyrna_prop_array_subscript_int(self, PyLong_AsLong(key));
|
return pyrna_prop_array_subscript_int(self, i);
|
||||||
}
|
}
|
||||||
else if (PySlice_Check(key)) {
|
else if (PySlice_Check(key)) {
|
||||||
Py_ssize_t step = 1;
|
Py_ssize_t step = 1;
|
||||||
|
Reference in New Issue
Block a user