libsaria: Remove idle::do_task()

It's a 2 line function that was used in only one place.  Time to remove
it and simplify the surrounding code.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-11-24 17:47:42 -05:00 committed by Anna Schumaker
parent 2f2c9cdf68
commit 9c72e56261
1 changed files with 4 additions and 9 deletions

View File

@ -58,12 +58,6 @@ bool IdleTask::should_cancel(void *d)
return false;
}
static void do_task(IdleTask *task)
{
task->run_task();
delete task;
}
static void queue_task(IdleTask *task)
{
idle_queue.push_back(task);
@ -100,12 +94,13 @@ namespace libsaria
int idle::run_task()
{
IdleTask *task;
if (size() == 0)
return 0;
task = idle_queue.front();
idle_queue[0]->run_task();
delete idle_queue[0];
idle_queue.pop_front();
do_task(task);
if (size() == 0) {
queued = 0.0;
serviced = 0.0;