From 3fde4c7669fad0d0cff463ff978962daa1dcd707 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 5 Dec 2013 19:26:16 +0900 Subject: [PATCH] nghttp2_map: Code cleanup --- lib/nghttp2_map.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/nghttp2_map.c b/lib/nghttp2_map.c index 77b060b0..1f7f53d0 100644 --- a/lib/nghttp2_map.c +++ b/lib/nghttp2_map.c @@ -28,8 +28,6 @@ #define INITIAL_TABLE_LENGTH 16 -#define LOAD_FACTOR 75 - int nghttp2_map_init(nghttp2_map *map) { map->tablelen = INITIAL_TABLE_LENGTH; @@ -144,7 +142,8 @@ static int resize(nghttp2_map *map, size_t new_tablelen) int nghttp2_map_insert(nghttp2_map *map, nghttp2_map_entry *new_entry) { int rv; - if(100 * (map->size + 1) > map->tablelen * LOAD_FACTOR) { + /* Load factor is 0.75 */ + if((map->size + 1) * 4 > map->tablelen * 3) { rv = resize(map, map->tablelen * 2); if(rv != 0) { return rv;