Permalink
Browse files

nghttp2_hd: fix It is odd that the body of 'hd_get_num_table_entries'…

… function is fully equivalent to the body of 'get_max_index' function found by PVS Studio (V524)
  • Loading branch information...
1 parent 87d1692 commit ae87a44b94aef53eb52edde7666439cbed67bd7d @alagoutte alagoutte committed Jan 3, 2017
Showing with 2 additions and 6 deletions.
  1. +2 −6 lib/nghttp2_hd.c
View
@@ -2281,10 +2281,6 @@ ssize_t nghttp2_hd_decode_length(uint32_t *res, size_t *shift_ptr, int *fin,
return decode_length(res, shift_ptr, fin, initial, shift, in, last, prefix);
}
-static size_t hd_get_num_table_entries(nghttp2_hd_context *context) {
- return context->hd_table.len + NGHTTP2_STATIC_TABLE_LENGTH;
-}
-
static const nghttp2_nv *hd_get_table_entry(nghttp2_hd_context *context,
size_t idx) {
if (idx == 0) {
@@ -2301,7 +2297,7 @@ static const nghttp2_nv *hd_get_table_entry(nghttp2_hd_context *context,
}
size_t nghttp2_hd_deflate_get_num_table_entries(nghttp2_hd_deflater *deflater) {
- return hd_get_num_table_entries(&deflater->ctx);
+ return get_max_index(&deflater->ctx);
}
const nghttp2_nv *
@@ -2320,7 +2316,7 @@ nghttp2_hd_deflate_get_max_dynamic_table_size(nghttp2_hd_deflater *deflater) {
}
size_t nghttp2_hd_inflate_get_num_table_entries(nghttp2_hd_inflater *inflater) {
- return hd_get_num_table_entries(&inflater->ctx);
+ return get_max_index(&inflater->ctx);
}
const nghttp2_nv *

0 comments on commit ae87a44

Please sign in to comment.