diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/sim_object.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sim/sim_object.cc b/sim/sim_object.cc index 5c8e3eb9b..b524d6075 100644 --- a/sim/sim_object.cc +++ b/sim/sim_object.cc @@ -131,6 +131,13 @@ SimObject::regAllStats() void SimObject::resetAllStats() { + SimObjectList::iterator i = simObjectList.begin(); + SimObjectList::iterator end = simObjectList.end(); + + for (; i != end; ++i) { + SimObject *obj = *i; + obj->resetStats(); + } } // @@ -139,9 +146,11 @@ SimObject::resetAllStats() void SimObject::printAllExtraOutput(ostream &os) { - SimObjectList::iterator i; + SimObjectList::iterator i = simObjectList.begin(); + SimObjectList::iterator end = simObjectList.end(); - for (i = simObjectList.begin(); i != simObjectList.end(); ++i) { - (*i)->printExtraOutput(os); + for (; i != end; ++i) { + SimObject *obj = *i; + obj->printExtraOutput(os); } } |