Skip to content

Commit e91b21f

Browse files
Avoid intermediate array from split (#1093)
Match first sequence of non-whitespace characters.
1 parent 6349b03 commit e91b21f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/irb/debug.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def DEBUGGER__.capture_frames(*args)
6060
if !DEBUGGER__::CONFIG[:no_hint] && irb.context.io.is_a?(RelineInputMethod)
6161
Reline.output_modifier_proc = proc do |input, complete:|
6262
unless input.strip.empty?
63-
cmd = input.split(/\s/, 2).first
63+
cmd = input[/\S+/]
6464

6565
if !complete && DEBUGGER__.commands.key?(cmd)
6666
input = input.sub(/\n$/, " # debug command\n")

0 commit comments

Comments
 (0)