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/object/object_edit.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/object/object_edit.c')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index ee9b6b411ce..5506895613b 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -166,7 +166,7 @@ static int object_hide_view_clear_exec(bContext *C, wmOperator *op) const bool select = RNA_boolean_get(op->ptr, "select"); bool changed = false; - for (Base *base = view_layer->object_bases.first; base; base = base->next) { + LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { if (base->flag & BASE_HIDDEN) { base->flag &= ~BASE_HIDDEN; changed = true; @@ -217,7 +217,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op) bool changed = false; /* Hide selected or unselected objects. */ - for (Base *base = view_layer->object_bases.first; base; base = base->next) { + LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { if (!(base->flag & BASE_VISIBLE_VIEWLAYER)) { continue; } @@ -321,7 +321,7 @@ void ED_collection_hide_menu_draw(const bContext *C, uiLayout *layout) uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN); - for (LayerCollection *lc = lc_scene->layer_collections.first; lc; lc = lc->next) { + LISTBASE_FOREACH (LayerCollection *, lc, &lc_scene->layer_collections) { int index = BKE_layer_collection_findindex(view_layer, lc); uiLayout *row = uiLayoutRow(layout, false); @@ -414,7 +414,7 @@ static bool mesh_needs_keyindex(Main *bmain, const Mesh *me) return true; } if (ob->data == me) { - for (const ModifierData *md = ob->modifiers.first; md; md = md->next) { + LISTBASE_FOREACH (const ModifierData *, md, &ob->modifiers) { if (md->type == eModifierType_Hook) { return true; } @@ -1593,7 +1593,7 @@ static int move_to_collection_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - for (LinkData *link = objects.first; link; link = link->next) { + LISTBASE_FOREACH (LinkData *, link, &objects) { Object *ob = link->data; if (!is_link) { |