diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-13 07:47:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-13 07:47:03 +0300 |
commit | 8e58f932157d71ab50b76f5efb5b2ddd37b3b1b0 (patch) | |
tree | 61aab895851e437a7d4a4fde5db9475c5655b552 /source/blender/editors/armature | |
parent | aab4794512ef37ab18e6812b3c5fc57b5e251f87 (diff) |
Cleanup: remove redundant NULL check, reduce scope
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/pose_slide.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index 2f5d2f6c12d..d32faf9a9ea 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -270,9 +270,9 @@ static void draw_ticks(const float start_factor, /* Round initial_tick_factor up to the next tick_increment. */ int tick_percentage = ceil((start_factor * 100) / tick_increment) * tick_increment; - float tick_height = base_tick_height; while (tick_percentage <= (int)(end_factor * 100)) { + float tick_height; /* Different ticks have different heights. Multiples of 100% are the tallest, 50% is a bit * smaller and the rest is the minimum size. */ if (tick_percentage % 100 == 0) { @@ -578,22 +578,19 @@ static void pose_slide_exit(wmOperator *op) /* Remove UI drawing callback. */ ED_region_draw_cb_exit(pso->region_header->type, pso->draw_handle); - /* If data exists, clear its data and exit. */ - if (pso) { - /* Free the temp pchan links and their data. */ - poseAnim_mapping_free(&pso->pfLinks); + /* Free the temp pchan links and their data. */ + poseAnim_mapping_free(&pso->pfLinks); - /* Free RB-BST for keyframes (if it contained data). */ - BLI_dlrbTree_free(&pso->keys); + /* Free RB-BST for keyframes (if it contained data). */ + BLI_dlrbTree_free(&pso->keys); - if (pso->ob_data_array != NULL) { - MEM_freeN(pso->ob_data_array); - } - - /* Free data itself. */ - MEM_freeN(pso); + if (pso->ob_data_array != NULL) { + MEM_freeN(pso->ob_data_array); } + /* Free data itself. */ + MEM_freeN(pso); + /* Cleanup. */ op->customdata = NULL; } @@ -2258,7 +2255,7 @@ static void pose_propagate_fcurve( BezTriple *bezt; float refVal = 0.0f; bool keyExists; - int i, match; + int i; bool first = true; /* Skip if no keyframes to edit. */ @@ -2281,7 +2278,8 @@ static void pose_propagate_fcurve( * - if only doing selected keyframes, start from the first one */ if (mode != POSE_PROPAGATE_SELECTED_KEYS) { - match = BKE_fcurve_bezt_binarysearch_index(fcu->bezt, startFrame, fcu->totvert, &keyExists); + const int match = BKE_fcurve_bezt_binarysearch_index( + fcu->bezt, startFrame, fcu->totvert, &keyExists); if (fcu->bezt[match].vec[1][0] < startFrame) { i = match + 1; |