summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/file/filtask.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-10-20 22:15:25 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-22 09:47:59 +0200
commite06afb0c9546ddcde1cedd75f59001396ac6fdf2 (patch)
treec5e60976b74bd102bff3e58381e53bb949c6ea22 /ucb/source/ucp/file/filtask.cxx
parent8959bb300b05be9fafbf30e553b35fb517bdf786 (diff)
Simplify containers iterations in ucb, ucbhelper
Use range-based loop or replace with STL functions. Change-Id: I3cdb0f89523008199af1550de164a52b75c52ba5 Reviewed-on: https://gerrit.libreoffice.org/62088 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source/ucp/file/filtask.cxx')
-rw-r--r--ucb/source/ucp/file/filtask.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 71ca460b160e..7bdd707b9b10 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -512,11 +512,10 @@ TaskManager::registerNotifier( const OUString& aUnqPath, Notifier* pNotifier )
std::vector< Notifier* >& nlist = *( it->second.notifier );
- std::vector<Notifier*>::iterator it1 = nlist.begin();
- while( it1 != nlist.end() ) // Every "Notifier" only once
+ std::vector<Notifier*>::iterator it1 = std::find(nlist.begin(), nlist.end(), pNotifier);
+ if( it1 != nlist.end() ) // Every "Notifier" only once
{
- if( *it1 == pNotifier ) return;
- ++it1;
+ return;
}
nlist.push_back( pNotifier );
}
@@ -2761,11 +2760,9 @@ TaskManager::getContentExchangedEventListeners( const OUString& aOldPrefix,
// However, these may be in status BaseContent::Deleted
if( copyList != nullptr )
{
- std::vector< Notifier* >::iterator copyIt = copyList->begin();
- while( copyIt != copyList->end() )
+ for( const auto& rCopyPtr : *copyList )
{
- itnew->second.notifier->push_back( *copyIt );
- ++copyIt;
+ itnew->second.notifier->push_back( rCopyPtr );
}
}
}