From 690b90f1e2cb949a3cdfb02678be844c4808f2cb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Apr 2015 15:21:40 +1000 Subject: BMesh: minor optimization counting adjacent data add BM_***_count_is_over(), _count_is_equal() Useful if we only want to know if the count is a smaller value. --- source/blender/python/bmesh/bmesh_py_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/python') diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c index 2e32a571e3c..0dd6ee7d51a 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.c +++ b/source/blender/python/bmesh/bmesh_py_utils.c @@ -84,7 +84,7 @@ static PyObject *bpy_bm_utils_vert_collapse_edge(PyObject *UNUSED(self), PyObjec return NULL; } - if (BM_vert_edge_count(py_vert->v) > 2) { + if (BM_vert_edge_count_is_over(py_vert->v, 2)) { PyErr_SetString(PyExc_ValueError, "vert_collapse_edge(vert, edge): vert has more than 2 connected edges"); return NULL; @@ -150,7 +150,7 @@ static PyObject *bpy_bm_utils_vert_collapse_faces(PyObject *UNUSED(self), PyObje return NULL; } - if (BM_vert_edge_count(py_vert->v) > 2) { + if (BM_vert_edge_count_is_over(py_vert->v, 2)) { PyErr_SetString(PyExc_ValueError, "vert_collapse_faces(vert, edge): vert has more than 2 connected edges"); return NULL; -- cgit v1.2.3