summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/pqueue/pqueue.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2012-07-02 12:33:42 -0400
committerMatthew Garrett <mjg@redhat.com>2012-07-02 12:33:42 -0400
commite21cbf4d9bafebb2560d1acac1e47e879c7f7493 (patch)
tree308e31c8b7338e11843ac324ce20b89d765c3f45 /Cryptlib/OpenSSL/crypto/pqueue/pqueue.c
parent5b1bf5583c3b6b523446b2b938f5f8355f488052 (diff)
downloadefi-boot-shim-e21cbf4d9bafebb2560d1acac1e47e879c7f7493.tar.gz
efi-boot-shim-e21cbf4d9bafebb2560d1acac1e47e879c7f7493.zip
Update OpenSSL
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/pqueue/pqueue.c')
-rwxr-xr-xCryptlib/OpenSSL/crypto/pqueue/pqueue.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/Cryptlib/OpenSSL/crypto/pqueue/pqueue.c b/Cryptlib/OpenSSL/crypto/pqueue/pqueue.c
index 5cc18527..8ebba8a8 100755
--- a/Cryptlib/OpenSSL/crypto/pqueue/pqueue.c
+++ b/Cryptlib/OpenSSL/crypto/pqueue/pqueue.c
@@ -166,14 +166,13 @@ pqueue_pop(pqueue_s *pq)
pitem *
pqueue_find(pqueue_s *pq, PQ_64BIT priority)
{
- pitem *next, *prev = NULL;
+ pitem *next;
pitem *found = NULL;
if ( pq->items == NULL)
return NULL;
- for ( next = pq->items; next->next != NULL;
- prev = next, next = next->next)
+ for ( next = pq->items; next->next != NULL; next = next->next)
{
if ( pq_64bit_eq(&(next->priority), &priority))
{
@@ -189,13 +188,6 @@ pqueue_find(pqueue_s *pq, PQ_64BIT priority)
if ( ! found)
return NULL;
-#if 0 /* find works in peek mode */
- if ( prev == NULL)
- pq->items = next->next;
- else
- prev->next = next->next;
-#endif
-
return found;
}
@@ -234,3 +226,17 @@ pqueue_next(pitem **item)
return ret;
}
+
+int
+pqueue_size(pqueue_s *pq)
+{
+ pitem *item = pq->items;
+ int count = 0;
+
+ while(item != NULL)
+ {
+ count++;
+ item = item->next;
+ }
+ return count;
+}