scalar next_fire = std::numeric_limits<scalar>::max();
hash<unsigned,timer*,hash_function>::iterator it;
- for (it = timers_.begin(); it != timers_.end(); ++it)
+ for (it = timers_.begin(); it.valid(); ++it)
{
scalar absolute = (*it).second->absolute_;
if (absolute < next_fire) next_fire = absolute;
if (next_expiration_ > t) return;
hash<unsigned,timer*,hash_function>::iterator it;
- for (it = timers_.begin(); it != timers_.end(); ++it)
+ for (it = timers_.begin(); it.valid(); ++it)
{
timer* timer = (*it).second;
if (timer->is_expired()) timer->fire();
+
+ if (it.end()) break;
}
}