Tweaks to dictionary for performance

This commit is contained in:
2023-02-24 22:13:50 +11:00
parent c88c1b125d
commit 3aeddff736
3 changed files with 13 additions and 4 deletions

View File

@@ -209,6 +209,10 @@ Toy_Scope* Toy_popScope(Toy_Scope* scope) {
}
Toy_Scope* Toy_copyScope(Toy_Scope* original) {
if (original == NULL) {
return NULL;
}
Toy_Scope* scope = TOY_ALLOCATE(Toy_Scope, 1);
scope->ancestor = original->ancestor;
Toy_initLiteralDictionary(&scope->variables);