mirror of
https://github.com/systemd/systemd.git
synced 2024-11-08 11:27:32 +03:00
Merge pull request #1407 from dvdhrm/prioq
prioq: drop stability guarantee
This commit is contained in:
commit
04c4507098
@ -111,7 +111,7 @@ static unsigned shuffle_up(Prioq *q, unsigned idx) {
|
||||
|
||||
k = (idx-1)/2;
|
||||
|
||||
if (q->compare_func(q->items[k].data, q->items[idx].data) < 0)
|
||||
if (q->compare_func(q->items[k].data, q->items[idx].data) <= 0)
|
||||
break;
|
||||
|
||||
swap(q, idx, k);
|
||||
|
@ -242,12 +242,6 @@ static int pending_prioq_compare(const void *a, const void *b) {
|
||||
if (x->pending_iteration > y->pending_iteration)
|
||||
return 1;
|
||||
|
||||
/* Stability for the rest */
|
||||
if (x < y)
|
||||
return -1;
|
||||
if (x > y)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -277,12 +271,6 @@ static int prepare_prioq_compare(const void *a, const void *b) {
|
||||
if (x->priority > y->priority)
|
||||
return 1;
|
||||
|
||||
/* Stability for the rest */
|
||||
if (x < y)
|
||||
return -1;
|
||||
if (x > y)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -310,12 +298,6 @@ static int earliest_time_prioq_compare(const void *a, const void *b) {
|
||||
if (x->time.next > y->time.next)
|
||||
return 1;
|
||||
|
||||
/* Stability for the rest */
|
||||
if (x < y)
|
||||
return -1;
|
||||
if (x > y)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -343,12 +325,6 @@ static int latest_time_prioq_compare(const void *a, const void *b) {
|
||||
if (x->time.next + x->time.accuracy > y->time.next + y->time.accuracy)
|
||||
return 1;
|
||||
|
||||
/* Stability for the rest */
|
||||
if (x < y)
|
||||
return -1;
|
||||
if (x > y)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -370,12 +346,6 @@ static int exit_prioq_compare(const void *a, const void *b) {
|
||||
if (x->priority > y->priority)
|
||||
return 1;
|
||||
|
||||
/* Stability for the rest */
|
||||
if (x < y)
|
||||
return -1;
|
||||
if (x > y)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user