diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-11-18 13:43:28 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-18 17:36:54 +0100 |
commit | 587ef41f75b8ea0bcd03366178d42a324dcf481c (patch) | |
tree | a672c557221d4fec8abbaf83568ed9e7242323a5 /svx/source/sdr/animation/scheduler.cxx | |
parent | 8b83659bb8f3368a1df949d5bc84d7b2dd0370b4 (diff) |
Simplify containers iterations in svx/source/[s-u]*
Use range-based loop or replace with STL functions
Change-Id: I2ec3e58cc46c9286ef863c732912ca7a729bab62
Reviewed-on: https://gerrit.libreoffice.org/63522
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr/animation/scheduler.cxx')
-rw-r--r-- | svx/source/sdr/animation/scheduler.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/svx/source/sdr/animation/scheduler.cxx b/svx/source/sdr/animation/scheduler.cxx index a8fc3272be8b..4f32f101f999 100644 --- a/svx/source/sdr/animation/scheduler.cxx +++ b/svx/source/sdr/animation/scheduler.cxx @@ -88,12 +88,10 @@ namespace sdr } // execute events from the vector - ::std::vector< Event* >::const_iterator aEnd = aToBeExecutedList.end(); - for(::std::vector< Event* >::iterator aCandidate = aToBeExecutedList.begin(); - aCandidate != aEnd; ++aCandidate) + for(auto& rpCandidate : aToBeExecutedList) { // trigger event. This may re-insert the event to the scheduler again - (*aCandidate)->Trigger(mnTime); + rpCandidate->Trigger(mnTime); } } @@ -146,9 +144,8 @@ namespace sdr void Scheduler::InsertEvent(Event& rNew) { // insert maintaining time ordering - auto it = mvEvents.begin(); - while (it != mvEvents.end() && rNew.GetTime() >= (*it)->GetTime()) - it++; + auto it = std::find_if(mvEvents.begin(), mvEvents.end(), + [&rNew](const Event* pEvent) { return rNew.GetTime() < pEvent->GetTime(); }); mvEvents.insert(it, &rNew); checkTimeout(); } |