Prepped for #160, fixed a stack-shrink bug

This commit is contained in:
2024-12-17 21:18:45 +11:00
parent a28053d4e9
commit 3e17916a4a
9 changed files with 55 additions and 54 deletions

View File

@@ -107,7 +107,7 @@ void Toy_insertTable(Toy_Table** tableHandle, Toy_Value key, Toy_Value value) {
}
//expand the capacity
if ((*tableHandle)->count > (*tableHandle)->capacity * TOY_TABLE_EXPANSION_THRESHOLD) {
if ((*tableHandle)->count >= (*tableHandle)->capacity * TOY_TABLE_EXPANSION_THRESHOLD) {
(*tableHandle) = Toy_private_adjustTableCapacity((*tableHandle), (*tableHandle)->capacity * TOY_TABLE_EXPANSION_RATE);
}