*
**************************************************************************/
-#include "../config.h"
+#include "config.h"
#include <cerrno>
#include <ctime>
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;
}
}
-#if HAVE_CLOCK_GETTIME
+#if USE_CLOCK_GETTIME
// Since the monotonic clock will provide us with the time since the
// computer started, the number of seconds since that time could easily
}
-#else // ! HAVE_CLOCK_GETTIME
+#else // ! USE_CLOCK_GETTIME
// If we don't have posix timers, we'll have to use a different timing
SDL_Delay(Uint32(clamp(int(seconds * 1000.0), 0, 1000)));
}
-#endif // HAVE_CLOCK_GETTIME
+#endif // USE_CLOCK_GETTIME
} // namespace moof