according to
https://stackoverflow.com/questions/
15433381/performance-of-piter-cont-end-in-for-loop
not precomputing the value of end() can even lead to better performance.
if agreed by the c++ gurus of SimGrid, this change could be applied to
many other places in the code.
{
double minRes = Model::nextOccuringEventFull(now);
- for(auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; it++) {
+ for (auto it(getRunningActionSet()->begin()); it != getRunningActionSet()->end(); it++) {
NetworkAction *action = static_cast<NetworkAction*>(&*it);
if (action->latency_ > 0)
minRes = (minRes < 0) ? action->latency_ : std::min(minRes, action->latency_);
maxminSystem_->solve_fun(maxminSystem_);
double min = -1;
- for (auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; ++it) {
+
+ for (auto it(getRunningActionSet()->begin()); it != getRunningActionSet()->end(); ++it) {
Action *action = &*it;
double value = lmm_variable_getvalue(action->getVariable());
if (value > 0) {