Skip to content

Commit

Permalink
Remove unnecessary copying
Browse files Browse the repository at this point in the history
  • Loading branch information
evhub committed Feb 25, 2024
1 parent fcd1043 commit 1690531
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coconut/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,7 @@ def {mock_var}({mock_paramdef}):
{vars_var} = {{"{def_name}": {def_name}}}
else:
{vars_var} = _coconut.globals().copy()
{vars_var}.update(_coconut.locals().copy())
{vars_var}.update(_coconut.locals())
_coconut_exec({code_str}, {vars_var})
{func_name} = {func_from_vars}
''',
Expand Down
2 changes: 1 addition & 1 deletion coconut/compiler/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def add_default_expr(self, assign_to, default_expr):
self.add_def(handle_indentation("""
if {assign_to} is _coconut_sentinel:
{vars_var} = _coconut.globals().copy()
{vars_var}.update(_coconut.locals().copy())
{vars_var}.update(_coconut.locals())
{add_names_code}_coconut_exec({code_str}, {vars_var})
{assign_to} = {vars_var}["{assign_to}"]
""").format(
Expand Down

0 comments on commit 1690531

Please sign in to comment.