diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-12 08:21:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-12 10:38:14 +0300 |
commit | 690b90f1e2cb949a3cdfb02678be844c4808f2cb (patch) | |
tree | 770053fda356cc5792a488ea863bbf7bb6e0c634 /source/blender/bmesh/intern/bmesh_mods.c | |
parent | 6d2c3a245622fa836ae603666789970a2f83b1c1 (diff) |
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.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mods.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 7b3f64dc5cd..85e9ec3aa24 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -72,7 +72,8 @@ */ bool BM_vert_dissolve(BMesh *bm, BMVert *v) { - const int len = BM_vert_edge_count(v); + /* logic for 3 or more is identical */ + const int len = BM_vert_edge_count_ex(v, 3); if (len == 1) { BM_vert_kill(bm, v); /* will kill edges too */ @@ -97,7 +98,7 @@ bool BM_vert_dissolve(BMesh *bm, BMVert *v) return false; } } - else if (len == 2 && BM_vert_face_count(v) == 1) { + else if (len == 2 && BM_vert_face_count_is_equal(v, 1)) { /* boundary vertex on a face */ return (BM_vert_collapse_edge(bm, v->e, v, true, true) != NULL); } |