diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 13:41:06 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 14:38:07 +0300 |
commit | 3d48d99647b59a6f0461baa4456660917f1bbda6 (patch) | |
tree | 0183ca55640e5d8034ac59865ebc5a5071d29f1f /source/blender/python/mathutils/mathutils_Color.c | |
parent | 44b7354742ef3728f212edac1277c0d25fa59934 (diff) |
Cleanup: Python, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/python` module.
No functional changes.
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Color.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Color.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 08dede8ff78..6bffff467cd 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -347,7 +347,7 @@ static PyObject *Color_subscript(ColorObject *self, PyObject *item) } return Color_item(self, i); } - else if (PySlice_Check(item)) { + if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelength; if (PySlice_GetIndicesEx(item, COLOR_SIZE, &start, &stop, &step, &slicelength) < 0) { @@ -357,19 +357,17 @@ static PyObject *Color_subscript(ColorObject *self, PyObject *item) if (slicelength <= 0) { return PyTuple_New(0); } - else if (step == 1) { + if (step == 1) { return Color_slice(self, start, stop); } - else { - PyErr_SetString(PyExc_IndexError, "slice steps not supported with color"); - return NULL; - } - } - else { - PyErr_Format( - PyExc_TypeError, "color indices must be integers, not %.200s", Py_TYPE(item)->tp_name); + + PyErr_SetString(PyExc_IndexError, "slice steps not supported with color"); return NULL; } + + PyErr_Format( + PyExc_TypeError, "color indices must be integers, not %.200s", Py_TYPE(item)->tp_name); + return NULL; } static int Color_ass_subscript(ColorObject *self, PyObject *item, PyObject *value) @@ -384,7 +382,7 @@ static int Color_ass_subscript(ColorObject *self, PyObject *item, PyObject *valu } return Color_ass_item(self, i, value); } - else if (PySlice_Check(item)) { + if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelength; if (PySlice_GetIndicesEx(item, COLOR_SIZE, &start, &stop, &step, &slicelength) < 0) { @@ -394,16 +392,14 @@ static int Color_ass_subscript(ColorObject *self, PyObject *item, PyObject *valu if (step == 1) { return Color_ass_slice(self, start, stop, value); } - else { - PyErr_SetString(PyExc_IndexError, "slice steps not supported with color"); - return -1; - } - } - else { - PyErr_Format( - PyExc_TypeError, "color indices must be integers, not %.200s", Py_TYPE(item)->tp_name); + + PyErr_SetString(PyExc_IndexError, "slice steps not supported with color"); return -1; } + + PyErr_Format( + PyExc_TypeError, "color indices must be integers, not %.200s", Py_TYPE(item)->tp_name); + return -1; } /* -----------------PROTCOL DECLARATIONS-------------------------- */ |