Skip to content

Commit b0f8987

Browse files
committed
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
2 parents d9dfed9 + 1f9e18b commit b0f8987

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prio-queue.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void prio_queue_reverse(struct prio_queue *queue)
2121

2222
if (queue->compare != NULL)
2323
die("BUG: prio_queue_reverse() on non-LIFO queue");
24-
for (i = 0; i <= (j = (queue->nr - 1) - i); i++)
24+
for (i = 0; i < (j = (queue->nr - 1) - i); i++)
2525
swap(queue, i, j);
2626
}
2727

0 commit comments

Comments
 (0)