mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-23 13:00:17 +00:00
Update py_dict.c
This commit is contained in:
parent
94d8a40653
commit
1fe211d728
@ -251,7 +251,7 @@ static bool Dict__set(Dict* self, py_TValue* key, py_TValue* val) {
|
|||||||
self->length++;
|
self->length++;
|
||||||
// check if we need to rehash
|
// check if we need to rehash
|
||||||
float load_factor = (float)self->length / self->capacity;
|
float load_factor = (float)self->length / self->capacity;
|
||||||
if(load_factor > 0.3) Dict__rehash_2x(self);
|
if(load_factor > (self->index_is_short ? 0.3f : 0.4f)) Dict__rehash_2x(self);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user