diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-29 22:12:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-29 23:14:28 +0300 |
commit | 25ec4b437fe927205a810470cdc23efd7282c85b (patch) | |
tree | 6d7ba2fe73703915b4b94d3f2dab03fb731e9544 /source/blender/python/bmesh/bmesh_py_types_select.c | |
parent | 18d06e8d21ed8c9a19df4205abcd7ed17eb9af00 (diff) |
Cleanup: style, use braces for the Python API
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_types_select.c')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types_select.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c index ed631f7105b..e257c1bff4b 100644 --- a/source/blender/python/bmesh/bmesh_py_types_select.c +++ b/source/blender/python/bmesh/bmesh_py_types_select.c @@ -255,8 +255,9 @@ static PyObject *bpy_bmeditselseq_subscript(BPy_BMEditSelSeq *self, PyObject *ke /* don't need error check here */ if (PyIndex_Check(key)) { Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError); - if (i == -1 && PyErr_Occurred()) + if (i == -1 && PyErr_Occurred()) { return NULL; + } return bpy_bmeditselseq_subscript_int(self, i); } else if (PySlice_Check(key)) { @@ -278,14 +279,22 @@ static PyObject *bpy_bmeditselseq_subscript(BPy_BMEditSelSeq *self, PyObject *ke Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX; /* avoid PySlice_GetIndicesEx because it needs to know the length ahead of time. */ - if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) return NULL; - if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL; + if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) { + return NULL; + } + if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) { + return NULL; + } if (start < 0 || stop < 0) { /* only get the length for negative values */ Py_ssize_t len = bpy_bmeditselseq_length(self); - if (start < 0) start += len; - if (stop < 0) stop += len; + if (start < 0) { + start += len; + } + if (stop < 0) { + stop += len; + } } if (stop - start <= 0) { |