Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
stash: setup default diff output format if necessary
[gitweb.git]
/
prio-queue.c
diff --git
a/prio-queue.c
b/prio-queue.c
index a07845187233e429e00138cce7ade42e97a40d4b..d3f488cb05f29bc90e4e03810d9bf4b972d0834f 100644
(file)
--- a/
prio-queue.c
+++ b/
prio-queue.c
@@
-85,3
+85,12
@@
void *prio_queue_get(struct prio_queue *queue)
}
return result;
}
+
+void *prio_queue_peek(struct prio_queue *queue)
+{
+ if (!queue->nr)
+ return NULL;
+ if (!queue->compare)
+ return queue->array[queue->nr - 1].data;
+ return queue->array[0].data;
+}