mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 05:23:04 +01:00
Use range-based for loops in libopenrct2
This commit is contained in:
committed by
Michael Steenbeek
parent
3c2aaefc85
commit
628039dd8a
@@ -234,12 +234,11 @@ static const PredefinedTheme PredefinedThemes[] = {
|
||||
|
||||
static const WindowThemeDesc * GetWindowThemeDescriptor(rct_windowclass windowClass)
|
||||
{
|
||||
for (size_t i = 0; i < Util::CountOf(WindowThemeDescriptors); i++)
|
||||
for (const auto &desc : WindowThemeDescriptors)
|
||||
{
|
||||
const WindowThemeDesc * desc = &WindowThemeDescriptors[i];
|
||||
if (desc->WindowClass == windowClass)
|
||||
if (desc.WindowClass == windowClass)
|
||||
{
|
||||
return desc;
|
||||
return &desc;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
@@ -247,12 +246,11 @@ static const WindowThemeDesc * GetWindowThemeDescriptor(rct_windowclass windowCl
|
||||
|
||||
static const WindowThemeDesc * GetWindowThemeDescriptor(const utf8 * windowClassSZ)
|
||||
{
|
||||
for (size_t i = 0; i < Util::CountOf(WindowThemeDescriptors); i++)
|
||||
for (const auto &desc : WindowThemeDescriptors)
|
||||
{
|
||||
const WindowThemeDesc * desc = &WindowThemeDescriptors[i];
|
||||
if (String::Equals(desc->WindowClassSZ, windowClassSZ))
|
||||
if (String::Equals(desc.WindowClassSZ, windowClassSZ))
|
||||
{
|
||||
return desc;
|
||||
return &desc;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user