Skip to content

Commit 37fe153

Browse files
tikksstompng
andcommitted
Making build_statement not modify the given argument
Because improves readability and code quality. Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com>
1 parent 020c67c commit 37fe153

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/irb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ def build_statement(code)
11321132
return Statement::EmptyInput.new
11331133
end
11341134

1135-
code.dup.force_encoding(@context.io.encoding)
1135+
code = code.dup.force_encoding(@context.io.encoding)
11361136
if (command, arg = @context.parse_command(code))
11371137
command_class = Command.load_command(command)
11381138
Statement::Command.new(code, command_class, arg)

0 commit comments

Comments
 (0)