mirror of
https://github.com/systemd/systemd.git
synced 2024-11-08 11:27:32 +03:00
prioq: never shuffle identical entries
Skip shuffling identical entries in shuffle_up(), just like we already do in shuffle_down().
This commit is contained in:
parent
9dc5db34ad
commit
8a9d23e446
@ -101,7 +101,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);
|
||||
|
Loading…
Reference in New Issue
Block a user