Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-11-06 04:51:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-11-06 04:54:19 +0300
commitf11f7ce08e92463b8a7495ed60082546f228cb60 (patch)
treee48a9811ca300b5115837a12d633f0f1bc4da25b /source/blender/python/mathutils/mathutils_Matrix.c
parentd89fedf2667298042ed12a899fb2afe538a69901 (diff)
Cleanup: use ELEM macro (>2 args)
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Matrix.c')
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 0b9fa1841ec..87d16656d70 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -514,7 +514,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
angle = angle_wrap_rad(angle);
- if (matSize != 2 && matSize != 3 && matSize != 4) {
+ if (!ELEM(matSize, 2, 3, 4)) {
PyErr_SetString(PyExc_ValueError,
"Matrix.Rotation(): "
"can only return a 2x2 3x3 or 4x4 matrix");
@@ -653,7 +653,7 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
if (!PyArg_ParseTuple(args, "fi|O:Matrix.Scale", &factor, &matSize, &vec)) {
return NULL;
}
- if (matSize != 2 && matSize != 3 && matSize != 4) {
+ if (!ELEM(matSize, 2, 3, 4)) {
PyErr_SetString(PyExc_ValueError,
"Matrix.Scale(): "
"can only return a 2x2 3x3 or 4x4 matrix");
@@ -759,7 +759,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
if (!PyArg_ParseTuple(args, "Oi:Matrix.OrthoProjection", &axis, &matSize)) {
return NULL;
}
- if (matSize != 2 && matSize != 3 && matSize != 4) {
+ if (!ELEM(matSize, 2, 3, 4)) {
PyErr_SetString(PyExc_ValueError,
"Matrix.OrthoProjection(): "
"can only return a 2x2 3x3 or 4x4 matrix");
@@ -895,7 +895,7 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
if (!PyArg_ParseTuple(args, "siO:Matrix.Shear", &plane, &matSize, &fac)) {
return NULL;
}
- if (matSize != 2 && matSize != 3 && matSize != 4) {
+ if (!ELEM(matSize, 2, 3, 4)) {
PyErr_SetString(PyExc_ValueError,
"Matrix.Shear(): "
"can only return a 2x2 3x3 or 4x4 matrix");