Skip to content

Commit

Permalink
free variable memory when unsetting value
Browse files Browse the repository at this point in the history
i.e. `var =` should delete `var`, not set it to empty string
  • Loading branch information
phil294 committed Nov 28, 2022
1 parent edeaaf1 commit 29f68e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/run/runner.cr
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ module Run
{% if ! flag?(:release) %}
puts "[debug] set_user_var '#{var}': #{value}"
{% end %}
@user_vars[down] = value
if value.empty?
@user_vars.delete down
else
@user_vars[down] = value
end
end
end
# `var` is case insensitive
Expand Down

0 comments on commit 29f68e6

Please sign in to comment.