зеркало из https://github.com/microsoft/git.git
Merge branch 'jk/prio-queue-avoid-swap-with-self'
Code clean-up. * jk/prio-queue-avoid-swap-with-self: prio_queue_reverse: don't swap elements with themselves
This commit is contained in:
Коммит
b0f89870ea
|
@ -21,7 +21,7 @@ void prio_queue_reverse(struct prio_queue *queue)
|
|||
|
||||
if (queue->compare != NULL)
|
||||
die("BUG: prio_queue_reverse() on non-LIFO queue");
|
||||
for (i = 0; i <= (j = (queue->nr - 1) - i); i++)
|
||||
for (i = 0; i < (j = (queue->nr - 1) - i); i++)
|
||||
swap(queue, i, j);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче