diff options
author | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:15:01 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-04-03 20:27:46 +0300 |
commit | d138cbfb47e379edc1ee915a8c6ff65b01f000d6 (patch) | |
tree | f4773ecce897c32eaf75295dd5f6a8e730d471ed /source/blender/editors/animation/anim_motion_paths.c | |
parent | b0c1184875d39abac4a65a5d20e263ea6d841009 (diff) |
Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
Diffstat (limited to 'source/blender/editors/animation/anim_motion_paths.c')
-rw-r--r-- | source/blender/editors/animation/anim_motion_paths.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/animation/anim_motion_paths.c b/source/blender/editors/animation/anim_motion_paths.c index a4ecd346a01..4c10c66dfa6 100644 --- a/source/blender/editors/animation/anim_motion_paths.c +++ b/source/blender/editors/animation/anim_motion_paths.c @@ -228,7 +228,7 @@ static void motionpath_get_global_framerange(ListBase *targets, int *r_sfra, int { *r_sfra = INT_MAX; *r_efra = INT_MIN; - for (MPathTarget *mpt = targets->first; mpt; mpt = mpt->next) { + LISTBASE_FOREACH (MPathTarget *, mpt, targets) { *r_sfra = min_ii(*r_sfra, mpt->mpath->start_frame); *r_efra = max_ii(*r_efra, mpt->mpath->end_frame); } @@ -348,7 +348,7 @@ static void motionpath_calculate_update_range(MPathTarget *mpt, static void motionpath_free_free_tree_data(ListBase *targets) { - for (MPathTarget *mpt = targets->first; mpt; mpt = mpt->next) { + LISTBASE_FOREACH (MPathTarget *, mpt, targets) { BLI_dlrbTree_free(&mpt->keys); } } @@ -412,7 +412,7 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph, DEG_make_inactive(depsgraph); } - for (MPathTarget *mpt = targets->first; mpt; mpt = mpt->next) { + LISTBASE_FOREACH (MPathTarget *, mpt, targets) { mpt->ob_eval = DEG_get_evaluated_object(depsgraph, mpt->ob); AnimData *adt = BKE_animdata_from_id(&mpt->ob_eval->id); @@ -492,7 +492,7 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph, } /* clear recalc flags from targets */ - for (MPathTarget *mpt = targets->first; mpt; mpt = mpt->next) { + LISTBASE_FOREACH (MPathTarget *, mpt, targets) { bMotionPath *mpath = mpt->mpath; /* get pointer to animviz settings for each target */ |