Jelajahi Sumber

Update py_dict.c

blueloveTH 1 tahun lalu
induk
melakukan
178bfa4c32
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      src/public/py_dict.c

+ 2 - 2
src/public/py_dict.c

@@ -190,8 +190,8 @@ static bool Dict__set(Dict* self, py_TValue* key, py_TValue* val) {
         if(res == -1) return false;  // error
     }
     // no empty slot found
-    if(self->capacity >= self->entries.length * 20) {
-        // raise error if we reach the minimum load factor (5%)
+    if(self->capacity >= self->entries.length * 10) {
+        // raise error if we reach the minimum load factor (10%)
         return RuntimeError("dict has too much collision: %d/%d/%d",
                             self->entries.length,
                             self->entries.capacity,