diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-09-13 22:09:43 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-15 09:06:38 +0200 |
commit | 87b24ddbba056b4887ad4613a84686ab3d2218cd (patch) | |
tree | de2b00c93611512836c30f188e59496527e2f6d8 /xmlscript | |
parent | 7d6be61a62ca3724c67ab3fb93e60a2748d8a67e (diff) |
Simplify containers iterations in xmlhelp, xmlreader, xmlscript, xmlsecurity
Use range-based loop or replace with functions from std algorithm.
Change-Id: I5b1859da37c2a6c6e5e70602287bfc2ada951893
Reviewed-on: https://gerrit.libreoffice.org/60463
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xml_helper/xml_impctx.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx index face4f5ca01f..dfb4b8141be6 100644 --- a/xmlscript/source/xml_helper/xml_impctx.cxx +++ b/xmlscript/source/xml_helper/xml_impctx.cxx @@ -395,12 +395,10 @@ sal_Int32 DocumentHandlerImpl::getUidByUri( OUString const & Uri ) OUString DocumentHandlerImpl::getUriByUid( sal_Int32 Uid ) { MGuard guard( m_pMutex ); - t_OUString2LongMap::const_iterator iPos( m_URI2Uid.begin() ); - t_OUString2LongMap::const_iterator const iEnd( m_URI2Uid.end() ); - for ( ; iPos != iEnd; ++iPos ) + for (const auto& rURIUid : m_URI2Uid) { - if (iPos->second == Uid) - return iPos->first; + if (rURIUid.second == Uid) + return rURIUid.first; } throw container::NoSuchElementException( "no such xmlns uid!" , static_cast< OWeakObject * >(this) ); } |