Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
prio_queue_reverse: don't swap elements with themselves
[gitweb.git]
/
prio-queue.c
diff --git
a/prio-queue.c
b/prio-queue.c
index e4365b00d6c3366e6753fc6da3fe1a165ab1222d..76782b66d4dde5bf01190963b19c403856756860 100644
(file)
--- a/
prio-queue.c
+++ b/
prio-queue.c
@@
-23,7
+23,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);
}