From 1fe211d728623b9498294e1b181e060a498d4272 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 29 Jun 2025 22:01:37 +0800 Subject: [PATCH] Update py_dict.c --- src/public/py_dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/py_dict.c b/src/public/py_dict.c index 29ea5c83..024190fb 100644 --- a/src/public/py_dict.c +++ b/src/public/py_dict.c @@ -251,7 +251,7 @@ static bool Dict__set(Dict* self, py_TValue* key, py_TValue* val) { self->length++; // check if we need to rehash 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; }