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/interface/interface_region_menu_popup.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/interface/interface_region_menu_popup.c')
-rw-r--r-- | source/blender/editors/interface/interface_region_menu_popup.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c index dbec8e6d653..a161a449ba0 100644 --- a/source/blender/editors/interface/interface_region_menu_popup.c +++ b/source/blender/editors/interface/interface_region_menu_popup.c @@ -669,7 +669,7 @@ void UI_popup_block_close(bContext *C, wmWindow *win, uiBlock *block) /* In the case we have nested popups, * closing one may need to redraw another, see: T48874 */ - for (ARegion *region = screen->regionbase.first; region; region = region->next) { + LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) { ED_region_tag_refresh_ui(region); } } @@ -678,8 +678,8 @@ void UI_popup_block_close(bContext *C, wmWindow *win, uiBlock *block) bool UI_popup_block_name_exists(const bScreen *screen, const char *name) { - for (const ARegion *region = screen->regionbase.first; region; region = region->next) { - for (const uiBlock *block = region->uiblocks.first; block; block = block->next) { + LISTBASE_FOREACH (const ARegion *, region, &screen->regionbase) { + LISTBASE_FOREACH (const uiBlock *, block, ®ion->uiblocks) { if (STREQ(block->name, name)) { return true; } |