Skip to content

Commit

Permalink
Merge pull request #327 from ngtcp2/remove-pq-each
Browse files Browse the repository at this point in the history
Remove unused nghttp3_pq_each
  • Loading branch information
tatsuhiro-t authored Mar 2, 2025
2 parents 5776fc2 + 83b4938 commit b7f9c79
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
16 changes: 0 additions & 16 deletions lib/nghttp3_pq.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,4 @@ int nghttp3_pq_empty(const nghttp3_pq *pq) { return pq->length == 0; }

size_t nghttp3_pq_size(const nghttp3_pq *pq) { return pq->length; }

int nghttp3_pq_each(const nghttp3_pq *pq, nghttp3_pq_item_cb fun, void *arg) {
size_t i;

if (pq->length == 0) {
return 0;
}

for (i = 0; i < pq->length; ++i) {
if ((*fun)(pq->q[i], arg)) {
return 1;
}
}

return 0;
}

void nghttp3_pq_clear(nghttp3_pq *pq) { pq->length = 0; }
11 changes: 0 additions & 11 deletions lib/nghttp3_pq.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,6 @@ int nghttp3_pq_empty(const nghttp3_pq *pq);
*/
size_t nghttp3_pq_size(const nghttp3_pq *pq);

typedef int (*nghttp3_pq_item_cb)(nghttp3_pq_entry *item, void *arg);

/*
* nghttp3_pq_each applies |fun| to each item in |pq|. The |arg| is
* passed as arg parameter to callback function. This function must
* not change the ordering key. If the return value from callback is
* nonzero, this function returns 1 immediately without iterating
* remaining items. Otherwise this function returns 0.
*/
int nghttp3_pq_each(const nghttp3_pq *pq, nghttp3_pq_item_cb fun, void *arg);

/*
* nghttp3_pq_remove removes |item| from |pq|. |pq| must contain
* |item| otherwise the behavior is undefined.
Expand Down

0 comments on commit b7f9c79

Please sign in to comment.