From beea9421bdaed78d4ffdc7354f7de70109b9cfd1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 20 Aug 2017 15:28:06 +1000 Subject: PyAPI: avoid redundant PyLong_AsLong call Assigning to an RNA array converted from Python to C twice. --- source/blender/python/intern/bpy_rna.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/python') diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 67f2f1fdee6..0d3781ca176 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2712,7 +2712,7 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) 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)) { Py_ssize_t step = 1; -- cgit v1.2.3