From 87b24ddbba056b4887ad4613a84686ab3d2218cd Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Thu, 13 Sep 2018 22:09:43 +0300 Subject: 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 --- xmlscript/source/xml_helper/xml_impctx.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'xmlscript/source/xml_helper/xml_impctx.cxx') 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) ); } -- cgit