From a29686eeb3af051a00fbb8a8b9be06bcd050ec8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 7 Aug 2020 11:23:02 +0200 Subject: Cleanup: Blenlib, Clang-Tidy else-after-return fixes (incomplete) This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/blenlib` module. Not all warnings are addressed in this commit. No functional changes. --- source/blender/blenlib/intern/polyfill_2d_beautify.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source/blender/blenlib/intern/polyfill_2d_beautify.c') diff --git a/source/blender/blenlib/intern/polyfill_2d_beautify.c b/source/blender/blenlib/intern/polyfill_2d_beautify.c index 41364c5a3a9..7bfca149ffb 100644 --- a/source/blender/blenlib/intern/polyfill_2d_beautify.c +++ b/source/blender/blenlib/intern/polyfill_2d_beautify.c @@ -64,14 +64,14 @@ static int oedge_cmp(const void *a1, const void *a2) if (x1->verts[0] > x2->verts[0]) { return 1; } - else if (x1->verts[0] < x2->verts[0]) { + if (x1->verts[0] < x2->verts[0]) { return -1; } if (x1->verts[1] > x2->verts[1]) { return 1; } - else if (x1->verts[1] < x2->verts[1]) { + if (x1->verts[1] < x2->verts[1]) { return -1; } @@ -79,7 +79,7 @@ static int oedge_cmp(const void *a1, const void *a2) if (x1->e_half > x2->e_half) { return 1; } - else if (x1->e_half < x2->e_half) { + if (x1->e_half < x2->e_half) { return -1; } /* Should never get here, no two edges should be the same. */ @@ -141,7 +141,7 @@ float BLI_polyfill_beautify_quad_rotate_calc_ex(const float v1[2], if ((area_2x_123 >= 0.0f) != (area_2x_134 >= 0.0f)) { break; } - else if ((fabsf(area_2x_123) <= eps_zero_area) || (fabsf(area_2x_134) <= eps_zero_area)) { + if ((fabsf(area_2x_123) <= eps_zero_area) || (fabsf(area_2x_134) <= eps_zero_area)) { break; } @@ -150,11 +150,10 @@ float BLI_polyfill_beautify_quad_rotate_calc_ex(const float v1[2], if (lock_degenerate) { break; } - else { - return -FLT_MAX; /* always rotate */ - } + + return -FLT_MAX; /* always rotate */ } - else if ((fabsf(area_2x_234) <= eps_zero_area) || (fabsf(area_2x_241) <= eps_zero_area)) { + if ((fabsf(area_2x_234) <= eps_zero_area) || (fabsf(area_2x_241) <= eps_zero_area)) { return -FLT_MAX; /* always rotate */ } -- cgit v1.2.3