Commit 4ec3eafb by Tobias Langer Committed by Tobias Langer

Simplified check for invalid nodes in priority queue.

parent af13f98c
...@@ -134,15 +134,15 @@ embb_mtapi_task_t * embb_mtapi_priority_queue_pop(embb_mtapi_priority_queue_t* t ...@@ -134,15 +134,15 @@ embb_mtapi_task_t * embb_mtapi_priority_queue_pop(embb_mtapi_priority_queue_t* t
if(that->task_buffer[ii + 1] != MTAPI_NULL) { if(that->task_buffer[ii + 1] != MTAPI_NULL) {
left_deadline = get_deadline(that->task_buffer[ii + 1]->handle); left_deadline = get_deadline(that->task_buffer[ii + 1]->handle);
} else { } else {
/* set the time to an invalid value. */
left_deadline.seconds = ULLONG_MAX; left_deadline.seconds = ULLONG_MAX;
left_deadline.nanoseconds = ULONG_MAX;
} }
if(that->task_buffer[ii + 2] != MTAPI_NULL) { if(that->task_buffer[ii + 2] != MTAPI_NULL) {
right_deadline = get_deadline(that->task_buffer[ii + 2]->handle); right_deadline = get_deadline(that->task_buffer[ii + 2]->handle);
} else { } else {
/* set the time to an invalid value. */
right_deadline.seconds = ULLONG_MAX; right_deadline.seconds = ULLONG_MAX;
right_deadline.nanoseconds = ULONG_MAX;
} }
/* min Heap, swap with the smaller of both children. */ /* min Heap, swap with the smaller of both children. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment