diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-14 11:14:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-16 09:04:51 +0200 |
commit | 7d7a7862a7dccb6764f80258f28685a0da3cbbcb (patch) | |
tree | b7281950f84b12c4868542f103a23c1460d22863 /lingucomponent/source/spellcheck | |
parent | abeab40aeb2bf16c1438b5e5f0cd70b3e11f6b7a (diff) |
new loplugin:sequenceloop
look for places we should be using std::as_const on for-range
loops over uno::Sequence, to avoid triggering a copy
Change-Id: I7efb641bf09d37c87946f03428ee4eec90298c8a
Reviewed-on: https://gerrit.libreoffice.org/77441
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lingucomponent/source/spellcheck')
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 3bbf8cc66f36..1e88d04874c1 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -124,7 +124,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() uno::Sequence< OUString > aFormatList; aLinguCfg.GetSupportedDictionaryFormatsFor( "SpellCheckers", "org.openoffice.lingu.MySpellSpellChecker", aFormatList ); - for (auto const& format : aFormatList) + for (auto const& format : std::as_const(aFormatList)) { std::vector< SvtLinguConfigDictionaryEntry > aTmpDic( aLinguCfg.GetActiveDictionariesByFormat(format) ); @@ -150,7 +150,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() std::set<OUString> aLocaleNamesSet; for (auto const& dict : aDics) { - uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames ); + const uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames ); uno::Sequence< OUString > aLocations( dict.aLocations ); SAL_WARN_IF( aLocaleNames.hasElements() && !aLocations.hasElements(), @@ -200,7 +200,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() if (dict.aLocaleNames.hasElements() && dict.aLocations.hasElements()) { - uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames ); + const uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames ); // currently only one language per dictionary is supported in the actual implementation... // Thus here we work-around this by adding the same dictionary several times. @@ -238,7 +238,7 @@ sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale) if (!m_aSuppLocales.hasElements()) getLocales(); - for (auto const& suppLocale : m_aSuppLocales) + for (auto const& suppLocale : std::as_const(m_aSuppLocales)) { if (rLocale == suppLocale) { |