diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 04:30:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 04:32:54 +0300 |
commit | aa3a4973a30ff668a62447e18ac41f6c916b4a8b (patch) | |
tree | 1b24cc55995ba8b3d72aaabd9400a3e1e030d540 /source/blender/python/intern | |
parent | 7cb20d841da16d0bffb63154403267500e9941f5 (diff) |
Cleanup: use ELEM macro
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 0c8728f70fc..5ac76ab9ac1 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -118,7 +118,7 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args) } } - if (context_dict == NULL || context_dict == Py_None) { + if (ELEM(context_dict, NULL, Py_None)) { context_dict = NULL; } else if (!PyDict_Check(context_dict)) { @@ -220,7 +220,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) } } - if (context_dict == NULL || context_dict == Py_None) { + if (ELEM(context_dict, NULL, Py_None)) { context_dict = NULL; } else if (!PyDict_Check(context_dict)) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index cd0ec44e2ad..75bf639b890 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -5431,7 +5431,7 @@ static PyObject *pyprop_array_foreach_getset(BPy_PropertyArrayRNA *self, /* Get/set both take the same args currently. */ PyObject *seq; - if (prop_type != PROP_INT && prop_type != PROP_FLOAT) { + if (!ELEM(prop_type, PROP_INT, PROP_FLOAT)) { PyErr_Format(PyExc_TypeError, "foreach_get/set available only for int and float"); return NULL; } |