From c345f53e5efee810974debe39befb039730a5f53 Mon Sep 17 00:00:00 2001 From: zogodo <742782908@qq.com> Date: Thu, 26 Dec 2019 22:43:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TC1/timed_task/timed_task.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TC1/timed_task/timed_task.c b/TC1/timed_task/timed_task.c index 4094c68..d1697ca 100644 --- a/TC1/timed_task/timed_task.c +++ b/TC1/timed_task/timed_task.c @@ -28,8 +28,9 @@ bool AddTask(pTimedTask task) pTimedTask tmp = task_top; while (tmp) { - if ((task->prs_time > tmp->prs_time && task->prs_time <= tmp->next->prs_time) - || tmp->next == NULL) + if (tmp->next == NULL + || (task->prs_time >= tmp->prs_time + && task->prs_time < tmp->next->prs_time)) { task->next = tmp->next; tmp->next = task;