diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-04-17 02:06:02 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-04-17 02:06:02 +0200 |
commit | 6cbc63316b75e72a04e57ffca146e81ee89d645c (patch) | |
tree | 67a20bba1871e3453586434207627eedce777867 /lib/pqueue.c | |
parent | Merge pull request #304 from donaldsharp/pim_5549 (diff) | |
download | frr-6cbc63316b75e72a04e57ffca146e81ee89d645c.tar.xz frr-6cbc63316b75e72a04e57ffca146e81ee89d645c.zip |
lib: add removal by item to pqueue
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/pqueue.c')
-rw-r--r-- | lib/pqueue.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pqueue.c b/lib/pqueue.c index 0f870564d..fa502b462 100644 --- a/lib/pqueue.c +++ b/lib/pqueue.c @@ -188,3 +188,11 @@ pqueue_remove_at (int index, struct pqueue *queue) trickle_down (index, queue); } } + +void +pqueue_remove (void *data, struct pqueue *queue) +{ + for (int i = 0; i < queue->size; i++) + if (queue->array[i] == data) + pqueue_remove_at (i, queue); +} |