diff options
Diffstat (limited to 'source/blender/python/mathutils')
-rw-r--r-- | source/blender/python/mathutils/mathutils.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index a9a9ba8643c..e6be81f88a3 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -304,8 +304,9 @@ int Mathutils_RegisterCallback(Mathutils_Callback *cb) int _BaseMathObject_ReadCallback(BaseMathObject *self) { Mathutils_Callback *cb = mathutils_callbacks[self->cb_type]; - if (cb->get(self, self->cb_subtype) != -1) + if (LIKELY(cb->get(self, self->cb_subtype) != -1)) { return 0; + } if (!PyErr_Occurred()) { PyErr_Format(PyExc_RuntimeError, @@ -318,8 +319,9 @@ int _BaseMathObject_ReadCallback(BaseMathObject *self) int _BaseMathObject_WriteCallback(BaseMathObject *self) { Mathutils_Callback *cb = mathutils_callbacks[self->cb_type]; - if (cb->set(self, self->cb_subtype) != -1) + if (LIKELY(cb->set(self, self->cb_subtype) != -1)) { return 0; + } if (!PyErr_Occurred()) { PyErr_Format(PyExc_RuntimeError, @@ -332,8 +334,9 @@ int _BaseMathObject_WriteCallback(BaseMathObject *self) int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index) { Mathutils_Callback *cb = mathutils_callbacks[self->cb_type]; - if (cb->get_index(self, self->cb_subtype, index) != -1) + if (LIKELY(cb->get_index(self, self->cb_subtype, index) != -1)) { return 0; + } if (!PyErr_Occurred()) { PyErr_Format(PyExc_RuntimeError, @@ -346,8 +349,9 @@ int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index) int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index) { Mathutils_Callback *cb = mathutils_callbacks[self->cb_type]; - if (cb->set_index(self, self->cb_subtype, index) != -1) + if (LIKELY(cb->set_index(self, self->cb_subtype, index) != -1)) { return 0; + } if (!PyErr_Occurred()) { PyErr_Format(PyExc_RuntimeError, |