[Libreoffice-commits] core.git: linguistic/source
Eike Rathke
erack at redhat.com
Tue Aug 30 19:32:32 UTC 2016
linguistic/source/lngsvcmgr.cxx | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit 424d48d347c317fa1a542d65e68327aea08cb1ed
Author: Eike Rathke <erack at redhat.com>
Date: Tue Aug 30 21:31:04 2016 +0200
calling set::find() before set::insert() is unwise
... because the insert() fails anyway if the key exists already and
adding a find() only is a performance penalty.
Change-Id: I38da75754fb23b9db3b59e5a0bd81e5e5bb05ce2
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 566d6c4..8f45622 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -114,9 +114,8 @@ static uno::Sequence< lang::Locale > GetAvailLocales(
const lang::Locale *pLoc = aLoc.getConstArray();
LanguageType nLang = LinguLocaleToLanguage( pLoc[k] );
- // language not already added?
- if (aLanguages.find( nLang ) == aLanguages.end())
- aLanguages.insert( nLang );
+ // It's a set, so insertion fails if language was already added.
+ aLanguages.insert( nLang );
}
}
else
More information about the Libreoffice-commits
mailing list