summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-08-30 21:31:04 +0200
committerEike Rathke <erack@redhat.com>2016-08-30 21:31:37 +0200
commit424d48d347c317fa1a542d65e68327aea08cb1ed (patch)
treef09423418df1bf2cb8448c85b373edb2c5659e7e /linguistic
parent628bb5ce3c9774e9b499aad81bae300ef023b25c (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.cxx5
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