Skip to content
Snippets Groups Projects
Commit eb6b2429 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Also use floats for the task weights in the queue sorting.

parent 9fb26f0a
No related branches found
No related tags found
No related merge requests found
...@@ -259,7 +259,7 @@ struct task *queue_gettask(struct queue *q, const struct task *prev, ...@@ -259,7 +259,7 @@ struct task *queue_gettask(struct queue *q, const struct task *prev,
int k = ind; int k = ind;
if (k < qcount) { if (k < qcount) {
qtid[k] = qtid[qcount]; qtid[k] = qtid[qcount];
int w = qtasks[qtid[k]].weight; const float w = qtasks[qtid[k]].weight;
while (k > 0 && w > qtasks[qtid[(k - 1) / 2]].weight) { while (k > 0 && w > qtasks[qtid[(k - 1) / 2]].weight) {
int temp = q->tid[k]; int temp = q->tid[k];
q->tid[k] = q->tid[(k - 1) / 2]; q->tid[k] = q->tid[(k - 1) / 2];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment