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/space_outliner/outliner_sync.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/space_outliner/outliner_sync.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_sync.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c index c08c7f54405..35dd91ff061 100644 --- a/source/blender/editors/space_outliner/outliner_sync.c +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -96,8 +96,8 @@ void ED_outliner_select_sync_flag_outliners(const bContext *C) wmWindowManager *wm = CTX_wm_manager(C); for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { - for (ScrArea *area = screen->areabase.first; area; area = area->next) { - for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { if (sl->spacetype == SPACE_OUTLINER) { SpaceOutliner *soutliner = (SpaceOutliner *)sl; @@ -319,7 +319,7 @@ static void outliner_sync_selection_from_outliner(Scene *scene, SelectedItems *selected_items) { - for (TreeElement *te = tree->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, tree) { TreeStoreElem *tselem = TREESTORE(te); if (tselem->type == 0 && te->idcode == ID_OB) { @@ -500,7 +500,7 @@ static void outliner_sync_selection_to_outliner(ViewLayer *view_layer, SyncSelectActiveData *active_data, const SyncSelectTypes *sync_types) { - for (TreeElement *te = tree->first; te; te = te->next) { + LISTBASE_FOREACH (TreeElement *, te, tree) { TreeStoreElem *tselem = TREESTORE(te); if (tselem->type == 0 && te->idcode == ID_OB) { |