diff options
author | Eike Rathke <erack@redhat.com> | 2016-08-30 21:31:04 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-08-30 21:31:37 +0200 |
commit | 424d48d347c317fa1a542d65e68327aea08cb1ed (patch) | |
tree | f09423418df1bf2cb8448c85b373edb2c5659e7e /linguistic | |
parent | 628bb5ce3c9774e9b499aad81bae300ef023b25c (diff) |
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
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/lngsvcmgr.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 566d6c4e594e..8f456225bdb2 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 |