mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-01 05:22:25 +07:00
Refactor, simplify
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -347,6 +347,8 @@ int uev_run(uev_ctx_t *ctx, int flags)
|
||||
|
||||
if (!w->u.t.period)
|
||||
w->u.t.timeout = 0;
|
||||
if (!w->u.t.timeout)
|
||||
uev_timer_stop(w);
|
||||
break;
|
||||
|
||||
case UEV_CRON_TYPE:
|
||||
@@ -362,16 +364,9 @@ int uev_run(uev_ctx_t *ctx, int flags)
|
||||
w->u.c.when = 0;
|
||||
else
|
||||
w->u.c.when += w->u.c.interval;
|
||||
break;
|
||||
}
|
||||
|
||||
if (UEV_CRON_TYPE == w->type) {
|
||||
if (!w->u.c.when)
|
||||
uev_timer_stop(w);
|
||||
}
|
||||
if (UEV_TIMER_TYPE == w->type) {
|
||||
if (!w->u.t.timeout)
|
||||
uev_timer_stop(w);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user