1
0
mirror of https://github.com/git/git.git synced 2024-09-21 08:32:02 +02:00

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:
Junio C Hamano 2017-05-01 14:14:43 +09:00
commit b0f89870ea

View File

@ -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);
}