diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 18:25:04 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-07-03 18:42:45 +0300 |
commit | 651d1aa7c836892e95117e17716605a774c0220b (patch) | |
tree | 824c048f96f320fe1066e5d27ee7af5e19d57851 /source/blender/editors/transform/transform_convert.c | |
parent | 35ce16939cc972b2cb85192ca23994fc61b9fbdd (diff) |
Cleanup: Editors/Transform, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/transform` module.
No functional changes.
Diffstat (limited to 'source/blender/editors/transform/transform_convert.c')
-rw-r--r-- | source/blender/editors/transform/transform_convert.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 5d1fd1543df..d68489759fe 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -96,12 +96,10 @@ static int trans_data_compare_dist(const void *a, const void *b) if (td_a->dist < td_b->dist) { return -1; } - else if (td_a->dist > td_b->dist) { + if (td_a->dist > td_b->dist) { return 1; } - else { - return 0; - } + return 0; } static int trans_data_compare_rdist(const void *a, const void *b) @@ -112,12 +110,10 @@ static int trans_data_compare_rdist(const void *a, const void *b) if (td_a->rdist < td_b->rdist) { return -1; } - else if (td_a->rdist > td_b->rdist) { + if (td_a->rdist > td_b->rdist) { return 1; } - else { - return 0; - } + return 0; } static void sort_trans_data_dist_container(const TransInfo *t, TransDataContainer *tc) @@ -610,9 +606,7 @@ bool FrameOnMouseSide(char side, float frame, float cframe) if (side == 'R') { return (frame >= cframe); } - else { - return (frame <= cframe); - } + return (frame <= cframe); } /** \} */ @@ -670,7 +664,7 @@ void posttrans_fcurve_clean(FCurve *fcu, const int sel_flag, const bool use_hand found = true; break; } - else if (rk->frame < bezt->vec[1][0]) { + if (rk->frame < bezt->vec[1][0]) { /* Terminate early if have passed the supposed insertion point? */ break; } @@ -696,11 +690,10 @@ void posttrans_fcurve_clean(FCurve *fcu, const int sel_flag, const bool use_hand } return; } - else { - /* Compute the average values for each retained keyframe */ - LISTBASE_FOREACH (tRetainedKeyframe *, rk, &retained_keys) { - rk->val = rk->val / (float)rk->tot_count; - } + + /* Compute the average values for each retained keyframe */ + LISTBASE_FOREACH (tRetainedKeyframe *, rk, &retained_keys) { + rk->val = rk->val / (float)rk->tot_count; } /* 2) Delete all keyframes duplicating the "retained keys" found above @@ -925,13 +918,13 @@ int special_transform_moving(TransInfo *t) if (t->spacetype == SPACE_SEQ) { return G_TRANSFORM_SEQ; } - else if (t->spacetype == SPACE_GRAPH) { + if (t->spacetype == SPACE_GRAPH) { return G_TRANSFORM_FCURVES; } - else if ((t->flag & T_EDIT) || (t->flag & T_POSE)) { + if ((t->flag & T_EDIT) || (t->flag & T_POSE)) { return G_TRANSFORM_EDIT; } - else if (t->flag & (T_OBJECT | T_TEXTURE)) { + if (t->flag & (T_OBJECT | T_TEXTURE)) { return G_TRANSFORM_OBJ; } |