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/editors/uvedit/uvedit_rip.c | 25 +++++++++++------------ source/blender/editors/uvedit/uvedit_unwrap_ops.c | 6 ++---- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'source/blender/editors/uvedit') diff --git a/source/blender/editors/uvedit/uvedit_rip.c b/source/blender/editors/uvedit/uvedit_rip.c index 07bec2da1ae..421e58b1cb5 100644 --- a/source/blender/editors/uvedit/uvedit_rip.c +++ b/source/blender/editors/uvedit/uvedit_rip.c @@ -538,23 +538,22 @@ static bool uv_rip_pairs_loop_change_sides_test(BMLoop *l_switch, if (count_a + count_b == 4) { return count_a > count_b; } - else { - const float angle_a_before = uv_rip_pairs_calc_uv_angle( - l_switch, side_a, aspect_y, cd_loop_uv_offset); - const float angle_b_before = uv_rip_pairs_calc_uv_angle( - l_target, side_b, aspect_y, cd_loop_uv_offset); - UL(l_switch)->side = side_b; + const float angle_a_before = uv_rip_pairs_calc_uv_angle( + l_switch, side_a, aspect_y, cd_loop_uv_offset); + const float angle_b_before = uv_rip_pairs_calc_uv_angle( + l_target, side_b, aspect_y, cd_loop_uv_offset); - const float angle_a_after = uv_rip_pairs_calc_uv_angle( - l_switch, side_a, aspect_y, cd_loop_uv_offset); - const float angle_b_after = uv_rip_pairs_calc_uv_angle( - l_target, side_b, aspect_y, cd_loop_uv_offset); + UL(l_switch)->side = side_b; - UL(l_switch)->side = side_a; + const float angle_a_after = uv_rip_pairs_calc_uv_angle( + l_switch, side_a, aspect_y, cd_loop_uv_offset); + const float angle_b_after = uv_rip_pairs_calc_uv_angle( + l_target, side_b, aspect_y, cd_loop_uv_offset); - return fabsf(angle_a_before - angle_b_before) > fabsf(angle_a_after - angle_b_after); - } + UL(l_switch)->side = side_a; + + return fabsf(angle_a_before - angle_b_before) > fabsf(angle_a_after - angle_b_after); } /** diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 2f30ef1caa6..9f77bf31481 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -1885,12 +1885,10 @@ static int smart_uv_project_thickface_area_cmp_fn(const void *tf_a_p, const void if (tf_a->area < tf_b->area) { return 1; } - else if (tf_a->area > tf_b->area) { + if (tf_a->area > tf_b->area) { return -1; } - else { - return 0; - } + return 0; } static uint smart_uv_project_calculate_project_normals(const ThickFace *thick_faces, -- cgit v1.2.3