X-Git-Url: http://git.hcoop.net/clinton/bobotpp.git/blobdiff_plain/3c37f9a85bbaa0cd71b0345042bd4ab32c1e255f..66f624180e040d12f195a1467f103639a2670cfc:/source/BotInterp.C diff --git a/source/BotInterp.C b/source/BotInterp.C index 9a07be6..8b58d3e 100644 --- a/source/BotInterp.C +++ b/source/BotInterp.C @@ -150,13 +150,7 @@ BotInterp::AddTimer(int delay, SCM function) scm_gc_protect_object(function); Timer *timer = new Timer (++counter, when, function); - TimerList::iterator it = std::find_if (timers.begin (), timers.end (), - std::bind1st (timer_sort_p, timer)); - - if (it != timers.end ()) - timers.insert (it, timer); - else - timers.push_back (timer); + Utils::push_sorted (timers, timer, timer_sort_p); return scm_from_int (counter);