Remove nghttp2_pq_increase_key

This commit is contained in:
Tatsuhiro Tsujikawa 2015-08-21 23:35:17 +09:00
parent a4156cded3
commit 647e30619f
5 changed files with 0 additions and 44 deletions

View File

@ -180,8 +180,3 @@ int nghttp2_pq_each(nghttp2_pq *pq, nghttp2_pq_item_cb fun, void *arg) {
}
return 0;
}
void nghttp2_pq_increase_key(nghttp2_pq *pq, nghttp2_pq_entry *item) {
assert(pq->q[item->index] == item);
bubble_down(pq, item->index);
}

View File

@ -120,12 +120,6 @@ void nghttp2_pq_update(nghttp2_pq *pq, nghttp2_pq_item_cb fun, void *arg);
*/
int nghttp2_pq_each(nghttp2_pq *pq, nghttp2_pq_item_cb fun, void *arg);
/*
* Performs "increase-key" operation against |item|, assuming |item|
* is in |pq|, and its key is already updated.
*/
void nghttp2_pq_increase_key(nghttp2_pq *pq, nghttp2_pq_entry *item);
/*
* Removes |item| from priority queue.
*/

View File

@ -68,7 +68,6 @@ int main(int argc _U_, char *argv[] _U_) {
if (!CU_add_test(pSuite, "pq", test_nghttp2_pq) ||
!CU_add_test(pSuite, "pq_update", test_nghttp2_pq_update) ||
!CU_add_test(pSuite, "pq_remove", test_nghttp2_pq_remove) ||
!CU_add_test(pSuite, "pq_increase_key", test_nghttp2_pq_increase_key) ||
!CU_add_test(pSuite, "map", test_nghttp2_map) ||
!CU_add_test(pSuite, "map_functional", test_nghttp2_map_functional) ||
!CU_add_test(pSuite, "map_each_free", test_nghttp2_map_each_free) ||

View File

@ -224,34 +224,3 @@ void test_nghttp2_pq_remove(void) {
nghttp2_pq_free(&pq);
}
void test_nghttp2_pq_increase_key(void) {
nghttp2_pq pq;
node nodes[10];
int ans_key1[] = {1, 2, 3, 3, 4, 5};
int ans_val1[] = {1, 2, 0, 3, 4, 5};
int ans_key2[] = {0, 1, 2, 3, 4, 6};
int ans_val2[] = {0, 1, 2, 3, 4, 5};
nghttp2_pq_init(&pq, node_less, nghttp2_mem_default());
push_nodes(&pq, nodes, 6);
nodes[0].key = 3;
nghttp2_pq_increase_key(&pq, &nodes[0].ent);
check_nodes(&pq, 6, ans_key1, ans_val1);
nghttp2_pq_free(&pq);
nghttp2_pq_init(&pq, node_less, nghttp2_mem_default());
push_nodes(&pq, nodes, 6);
nodes[5].key = 6;
nghttp2_pq_increase_key(&pq, &nodes[5].ent);
check_nodes(&pq, 6, ans_key2, ans_val2);
nghttp2_pq_free(&pq);
}

View File

@ -28,6 +28,5 @@
void test_nghttp2_pq(void);
void test_nghttp2_pq_update(void);
void test_nghttp2_pq_remove(void);
void test_nghttp2_pq_increase_key(void);
#endif /* NGHTTP2_PQ_TEST_H */