From 156448ba4ba350dd6f9718b4610f14f4ba187af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 7 Aug 2020 11:49:59 +0200 Subject: Cleanup: Draw, Clang-Tidy else-after-return fixes (incomplete) This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/draw` module. Not all warnings are addressed in this commit. No functional changes. --- .../blender/draw/intern/draw_cache_impl_particles.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c') diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 331a1f80bec..3ecdbff1e96 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -128,9 +128,8 @@ static bool particle_batch_cache_valid(ParticleSystem *psys) if (cache->is_dirty == false) { return true; } - else { - return false; - } + + return false; return true; } @@ -647,14 +646,13 @@ static float particle_key_weight(const ParticleData *particle, int strand, float if (t == 1.0) { return hkeys[part->totkey - 1].weight; } - else { - float interp = t / edit_key_seg_t; - int index = (int)interp; - interp -= floorf(interp); /* Time between 2 edit key */ - float s1 = hkeys[index].weight; - float s2 = hkeys[index + 1].weight; - return s1 + interp * (s2 - s1); - } + + float interp = t / edit_key_seg_t; + int index = (int)interp; + interp -= floorf(interp); /* Time between 2 edit key */ + float s1 = hkeys[index].weight; + float s2 = hkeys[index + 1].weight; + return s1 + interp * (s2 - s1); } static int particle_batch_cache_fill_segments_edit( -- cgit v1.2.3