From dcd2c367c090bf42195e45d1d5a5bf32dabc4173 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Fri, 3 Mar 2017 13:51:10 +0100 Subject: [PATCH] more minor smells removed --- src/surf/cpu_interface.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index 768c4190f0..4e42b2199e 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -46,16 +46,12 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/) //without losing the event ascending order (considering all CPU's) double smaller = -1; ActionList *actionSet = getRunningActionSet(); - for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end()) - ; it != itend ; ++it) { + ActionList::iterator it(actionSet->begin()); + ActionList::iterator itend(actionSet->end()); + for (; it != itend; ++it) { CpuAction *action = static_cast(&*it); - if (smaller < 0) { - smaller = action->getLastUpdate(); - continue; - } - if (action->getLastUpdate() < smaller) { - smaller = action->getLastUpdate(); - } + if (smaller < 0 || action->getLastUpdate() < smaller) + smaller = action->getLastUpdate(); } if (smaller > 0) { TRACE_last_timestamp_to_dump = smaller; @@ -67,10 +63,9 @@ void CpuModel::updateActionsStateFull(double now, double delta) { CpuAction *action = nullptr; ActionList *running_actions = getRunningActionSet(); - - for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end()) - ; it != itend ; it=itNext) { - ++itNext; + ActionList::iterator it(running_actions->begin()); + ActionList::iterator itend(running_actions->end()) for (; it != itend; ++it) + { action = static_cast(&*it); if (TRACE_is_enabled()) { Cpu *cpu = static_cast (lmm_constraint_id(lmm_get_cnst_from_var(getMaxminSystem(), action->getVariable(), 0)) ); -- 2.20.1