From 1b272a649b40e99dba4185167f6cee7cbece1942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 7 Aug 2020 12:30:43 +0200 Subject: Cleanup: Blenkernel, Clang-Tidy else-after-return fixes This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/blenkernel` module. No functional changes. --- source/blender/blenkernel/intern/mesh_evaluate.c | 34 +++++++++++------------- 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'source/blender/blenkernel/intern/mesh_evaluate.c') diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index 49957b584ad..fe4b8a60796 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -1408,7 +1408,7 @@ static bool loop_split_generator_check_cyclic_smooth_fan(const MLoop *mloops, return false; } /* Smooth loop/edge... */ - else if (BLI_BITMAP_TEST(skip_loops, mlfan_vert_index)) { + if (BLI_BITMAP_TEST(skip_loops, mlfan_vert_index)) { if (mlfan_vert_index == ml_curr_index) { /* We walked around a whole cyclic smooth fan without finding any already-processed loop, * means we can use initial ml_curr/ml_prev edge as start for this smooth fan. */ @@ -1417,10 +1417,9 @@ static bool loop_split_generator_check_cyclic_smooth_fan(const MLoop *mloops, /* ... already checked in some previous looping, we can abort. */ return false; } - else { - /* ... we can skip it in future, and keep checking the smooth fan. */ - BLI_BITMAP_ENABLE(skip_loops, mlfan_vert_index); - } + + /* ... we can skip it in future, and keep checking the smooth fan. */ + BLI_BITMAP_ENABLE(skip_loops, mlfan_vert_index); } } @@ -2315,22 +2314,21 @@ float BKE_mesh_calc_poly_area(const MPoly *mpoly, const MLoop *loopstart, const return area_tri_v3( mvarray[loopstart[0].v].co, mvarray[loopstart[1].v].co, mvarray[loopstart[2].v].co); } - else { - int i; - const MLoop *l_iter = loopstart; - float area; - float(*vertexcos)[3] = BLI_array_alloca(vertexcos, (size_t)mpoly->totloop); - - /* pack vertex cos into an array for area_poly_v3 */ - for (i = 0; i < mpoly->totloop; i++, l_iter++) { - copy_v3_v3(vertexcos[i], mvarray[l_iter->v].co); - } - /* finally calculate the area */ - area = area_poly_v3((const float(*)[3])vertexcos, (unsigned int)mpoly->totloop); + int i; + const MLoop *l_iter = loopstart; + float area; + float(*vertexcos)[3] = BLI_array_alloca(vertexcos, (size_t)mpoly->totloop); - return area; + /* pack vertex cos into an array for area_poly_v3 */ + for (i = 0; i < mpoly->totloop; i++, l_iter++) { + copy_v3_v3(vertexcos[i], mvarray[l_iter->v].co); } + + /* finally calculate the area */ + area = area_poly_v3((const float(*)[3])vertexcos, (unsigned int)mpoly->totloop); + + return area; } float BKE_mesh_calc_area(const Mesh *me) -- cgit v1.2.3