Cleanup: use ELEM macro
This commit is contained in:
@@ -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)) {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user