diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-03-10 21:51:45 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-12 16:10:01 +0100 |
commit | 95a538180fd21c52b752cbef46acf2aa2b842ab8 (patch) | |
tree | 6b248190da44e68400fbd663dbb17d5fd6c4223d /chart2/source/tools/ObjectIdentifier.cxx | |
parent | f9b354784faf65ecc8024cf6d7d7aaf589f6d91f (diff) |
Simplify containers iterations in chart2, cli_ure, comphelper, configmgr
Use range-based loop or replace with STL functions
Change-Id: I7c229faa96e08b76cb4f182a1bd77c15bac4ba76
Reviewed-on: https://gerrit.libreoffice.org/69010
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools/ObjectIdentifier.cxx')
-rw-r--r-- | chart2/source/tools/ObjectIdentifier.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 256be65e535f..40c7380d3c23 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -1436,15 +1436,10 @@ TitleHelper::eTitleType ObjectIdentifier::getTitleTypeForCID( const OUString& rC OUString aParentParticle = ObjectIdentifier::getFullParentParticle( rCID ); const tTitleMap& rMap = lcl_getTitleMap(); - tTitleMap::const_iterator aIt( rMap.begin() ); - for( ;aIt != rMap.end(); ++aIt ) - { - if( aParentParticle == (*aIt).second ) - { - eRet = (*aIt).first; - break; - } - } + tTitleMap::const_iterator aIt = std::find_if(rMap.begin(), rMap.end(), + [&aParentParticle](tTitleMap::const_reference rEntry) { return aParentParticle == rEntry.second; }); + if (aIt != rMap.end()) + eRet = (*aIt).first; return eRet; } |