diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:23:02 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:23:02 +0300 |
commit | a29686eeb3af051a00fbb8a8b9be06bcd050ec8c (patch) | |
tree | 9da60e7257e3e2dafda3e9b565b77c9c6f37675b /source/blender/blenlib/intern/polyfill_2d_beautify.c | |
parent | e0c51b466f3b23a1fc114690be2b008e19637ea6 (diff) |
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.
Diffstat (limited to 'source/blender/blenlib/intern/polyfill_2d_beautify.c')
-rw-r--r-- | source/blender/blenlib/intern/polyfill_2d_beautify.c | 15 |
1 files changed, 7 insertions, 8 deletions
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 */ } |