minor gratuitous cleanup in printAllExtraOutput.
(only create one end iterator)
Fix average stats reset
base/statistics.hh:
Shouldn't reset average stats this way. The current stat value
should stay the same.
sim/sim_object.cc:
Ok, actually call resetStats on all stats
minor gratuitous cleanup in printAllExtraOutput.
(only create one end iterator)
--HG--
extra : convert_revision :
13090ebe490a93757b8eb7d7c6a9697983095e41
*/
void reset()
{
- current = T();
total = 0;
last = curTick;
}
void
SimObject::resetAllStats()
{
+ SimObjectList::iterator i = simObjectList.begin();
+ SimObjectList::iterator end = simObjectList.end();
+
+ for (; i != end; ++i) {
+ SimObject *obj = *i;
+ obj->resetStats();
+ }
}
//
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);
}
}