diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-11-20 01:01:35 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-01-31 17:07:46 +0100 |
commit | 63d4ee1968144cc3d115f92baef95785abf813ac (patch) | |
tree | 8a06b6882e8e57e1978b521158c288ff6c8f2dd9 /src/qt/platformstyle.cpp | |
parent | 4c55f92c7644c267997c7ddab37d195216d6cf39 (diff) |
refactor: iterate arrays via C++11 range-based for loops if idx is not needed
Diffstat (limited to 'src/qt/platformstyle.cpp')
-rw-r--r-- | src/qt/platformstyle.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/qt/platformstyle.cpp b/src/qt/platformstyle.cpp index c6b80fd340..aab8d8e4af 100644 --- a/src/qt/platformstyle.cpp +++ b/src/qt/platformstyle.cpp @@ -23,7 +23,6 @@ static const struct { /* Other: linux, unix, ... */ {"other", true, true, false} }; -static const unsigned platform_styles_count = sizeof(platform_styles)/sizeof(*platform_styles); namespace { /* Local functions for colorizing single-color images */ @@ -121,15 +120,13 @@ QIcon PlatformStyle::TextColorIcon(const QIcon& icon) const const PlatformStyle *PlatformStyle::instantiate(const QString &platformId) { - for (unsigned x=0; x<platform_styles_count; ++x) - { - if (platformId == platform_styles[x].platformId) - { + for (const auto& platform_style : platform_styles) { + if (platformId == platform_style.platformId) { return new PlatformStyle( - platform_styles[x].platformId, - platform_styles[x].imagesOnButtons, - platform_styles[x].colorizeIcons, - platform_styles[x].useExtraSpacing); + platform_style.platformId, + platform_style.imagesOnButtons, + platform_style.colorizeIcons, + platform_style.useExtraSpacing); } } return nullptr; |