1
0
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:
David Herrmann 2015-09-29 20:41:29 +02:00
parent 9dc5db34ad
commit 8a9d23e446

View File

@ -101,7 +101,7 @@ static unsigned shuffle_up(Prioq *q, unsigned idx) {
k = (idx-1)/2; 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; break;
swap(q, idx, k); swap(q, idx, k);