fixed hashtable->get_count() after doubling table size
This commit is contained in:
@@ -165,7 +165,6 @@ static u_int get_nearest_powerof2(u_int n)
|
|||||||
static void init_hashtable(private_hashtable_t *this, u_int capacity)
|
static void init_hashtable(private_hashtable_t *this, u_int capacity)
|
||||||
{
|
{
|
||||||
capacity = max(1, min(capacity, MAX_CAPACITY));
|
capacity = max(1, min(capacity, MAX_CAPACITY));
|
||||||
this->count = 0;
|
|
||||||
this->capacity = get_nearest_powerof2(capacity);
|
this->capacity = get_nearest_powerof2(capacity);
|
||||||
this->mask = this->capacity - 1;
|
this->mask = this->capacity - 1;
|
||||||
this->load_factor = 0.75;
|
this->load_factor = 0.75;
|
||||||
|
|||||||
Reference in New Issue
Block a user