diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-05-01 14:14:43 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-01 14:14:43 +0900 |
commit | b0f89870ea54b86fb7935f90605d329533849b33 (patch) | |
tree | f67ea62db44f5454a9309cdcfba03155929aca23 /prio-queue.c | |
parent | d9dfed9e47436644bcb7dec24cdb1c1975f70910 (diff) | |
parent | 1f9e18b77282070e8fef6dbe6983a8c94a3b0efa (diff) | |
download | git-b0f89870ea54b86fb7935f90605d329533849b33.tar.gz |
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
Diffstat (limited to 'prio-queue.c')
-rw-r--r-- | prio-queue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/prio-queue.c b/prio-queue.c index 17252d231b..fc3860fdcb 100644 --- a/prio-queue.c +++ b/prio-queue.c @@ -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); } |