svtools/source/config/colorcfg.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
New commits: commit ba26de65b4f131ca3c76941dbb73dd9d3afde0d1 Author: Simon Chenery <simon_chen...@yahoo.com> AuthorDate: Sun Dec 8 10:53:48 2024 +0100 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Sat Dec 28 15:44:06 2024 +0100 tdf#153109 Use any_of instead of loop to check for match Change-Id: I1ff9ff36520391bced7229eede86335d0a2b411f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178073 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index 6787c43b8fa8..544e544cf398 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -174,15 +174,8 @@ void ColorConfig_Impl::Load(const OUString& rScheme) if (!ThemeColors::IsAutomaticTheme(sScheme)) { uno::Sequence<OUString> aSchemes = GetSchemeNames(); - bool bFound = false; - for (const OUString& rSchemeName : aSchemes) - { - if (sScheme == rSchemeName) - { - bFound = true; - break; - } - } + bool bFound = std::any_of(aSchemes.begin(), aSchemes.end(), + [&sScheme](const OUString& rSchemeName) { return sScheme == rSchemeName; }); if (!bFound) sScheme = AUTOMATIC_COLOR_SCHEME;