Skip to content

Commit

Permalink
Making build_statement not modify the given argument
Browse files Browse the repository at this point in the history
Because improves readability and code quality.

Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com>
  • Loading branch information
tikkss and tompng committed Oct 14, 2024
1 parent 020c67c commit 37fe153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ def build_statement(code)
return Statement::EmptyInput.new
end

code.dup.force_encoding(@context.io.encoding)
code = code.dup.force_encoding(@context.io.encoding)
if (command, arg = @context.parse_command(code))
command_class = Command.load_command(command)
Statement::Command.new(code, command_class, arg)
Expand Down

0 comments on commit 37fe153

Please sign in to comment.