summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-19 16:08:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-20 08:00:44 +0200
commit587bd15487f78dc0e973ea811a4200612ceeda5d (patch)
tree16765b644d1bd55f5aa1bf30392cab47a06ccd68
parent35e80e9726b5fee6a00caa58349a4b5d924dad7c (diff)
use equal_range instead of lower_bound+upper_bound
Change-Id: I7cc1c95b3a55630e3571cac5fe22be6c2f3a1bc9 Reviewed-on: https://gerrit.libreoffice.org/62015 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--svx/source/smarttags/SmartTagMgr.cxx5
-rw-r--r--unoxml/source/events/eventdispatcher.cxx5
2 files changed, 4 insertions, 6 deletions
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx
index 8ffebc7cc27d..b7cb3a3dbf2f 100644
--- a/svx/source/smarttags/SmartTagMgr.cxx
+++ b/svx/source/smarttags/SmartTagMgr.cxx
@@ -160,10 +160,9 @@ void SmartTagMgr::GetActionSequences( std::vector< OUString >& rSmartTagTypes,
Sequence< sal_Int32 > aIndices( nNumberOfActionRefs );
sal_uInt16 i = 0;
- auto aActionsIter = maSmartTagMap.lower_bound( rSmartTagType );
- auto aEnd = maSmartTagMap.upper_bound( rSmartTagType );
+ auto iters = maSmartTagMap.equal_range( rSmartTagType );
- for ( ; aActionsIter != aEnd; ++aActionsIter )
+ for ( auto aActionsIter = iters.first; aActionsIter != iters.second; ++aActionsIter )
{
aActions[ i ] = (*aActionsIter).second.mxSmartTagAction;
aIndices[ i++ ] = (*aActionsIter).second.mnSmartTagIndex;
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx
index ff5ce7aa8889..b5d5ef705b31 100644
--- a/unoxml/source/events/eventdispatcher.cxx
+++ b/unoxml/source/events/eventdispatcher.cxx
@@ -92,9 +92,8 @@ namespace DOM { namespace events {
TypeListenerMap::const_iterator tIter = rTMap.find(aType);
if (tIter != rTMap.end()) {
ListenerMap const& rMap = tIter->second;
- auto iter = rMap.lower_bound(pNode);
- auto const ibound = rMap.upper_bound(pNode);
- for( ; iter != ibound; ++iter )
+ auto iterRange = rMap.equal_range(pNode);
+ for( auto iter = iterRange.first; iter != iterRange.second; ++iter )
{
if(iter->second.is())
(iter->second)->handleEvent(xEvent);