From 847e5f33d4749568cda696b8940ec10b540bd6fb Mon Sep 17 00:00:00 2001 From: glx Date: Tue, 17 Dec 2019 21:21:33 +0100 Subject: Codechange: Replace story related FOR_ALL with range-based for loops --- src/script/api/script_storypageelementlist.cpp | 3 +-- src/script/api/script_storypagelist.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/script') diff --git a/src/script/api/script_storypageelementlist.cpp b/src/script/api/script_storypageelementlist.cpp index 5df7dbf0a..ce60963f2 100644 --- a/src/script/api/script_storypageelementlist.cpp +++ b/src/script/api/script_storypageelementlist.cpp @@ -17,8 +17,7 @@ ScriptStoryPageElementList::ScriptStoryPageElementList(ScriptStoryPage::StoryPag { if (!ScriptStoryPage::IsValidStoryPage(story_page_id)) return; - StoryPageElement *pe; - FOR_ALL_STORY_PAGE_ELEMENTS(pe) { + for (StoryPageElement *pe : StoryPageElement::Iterate()) { if (pe->page == story_page_id) { this->AddItem(pe->index); } diff --git a/src/script/api/script_storypagelist.cpp b/src/script/api/script_storypagelist.cpp index fc515472a..63f835ada 100644 --- a/src/script/api/script_storypagelist.cpp +++ b/src/script/api/script_storypagelist.cpp @@ -19,8 +19,7 @@ ScriptStoryPageList::ScriptStoryPageList(ScriptCompany::CompanyID company) uint8 c = company; if (company == ScriptCompany::COMPANY_INVALID) c = INVALID_COMPANY; - StoryPage *p; - FOR_ALL_STORY_PAGES(p) { + for (StoryPage *p : StoryPage::Iterate()) { if (p->company == c || p->company == INVALID_COMPANY) { this->AddItem(p->index); } -- cgit v1.2.3-54-g00ecf