From 647e30619fd689747c71dfa046d6f529c97ba097 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 21 Aug 2015 23:35:17 +0900 Subject: [PATCH] Remove nghttp2_pq_increase_key --- lib/nghttp2_pq.c | 5 ----- lib/nghttp2_pq.h | 6 ------ tests/main.c | 1 - tests/nghttp2_pq_test.c | 31 ------------------------------- tests/nghttp2_pq_test.h | 1 - 5 files changed, 44 deletions(-) diff --git a/lib/nghttp2_pq.c b/lib/nghttp2_pq.c index a738084b..54c3eca4 100644 --- a/lib/nghttp2_pq.c +++ b/lib/nghttp2_pq.c @@ -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); -} diff --git a/lib/nghttp2_pq.h b/lib/nghttp2_pq.h index f4cb6db3..6b0ecfb4 100644 --- a/lib/nghttp2_pq.h +++ b/lib/nghttp2_pq.h @@ -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. */ diff --git a/tests/main.c b/tests/main.c index 9ca387d2..7239f995 100644 --- a/tests/main.c +++ b/tests/main.c @@ -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) || diff --git a/tests/nghttp2_pq_test.c b/tests/nghttp2_pq_test.c index 76278125..c37b156a 100644 --- a/tests/nghttp2_pq_test.c +++ b/tests/nghttp2_pq_test.c @@ -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); -} diff --git a/tests/nghttp2_pq_test.h b/tests/nghttp2_pq_test.h index 7a8afe25..2936174e 100644 --- a/tests/nghttp2_pq_test.h +++ b/tests/nghttp2_pq_test.h @@ -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 */