Skip to content

Commit fa05ffa

Browse files
WillHaltoko1
authored andcommitted
refactor for readability
1 parent 7619241 commit fa05ffa

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/debug/thread_client.rb

+5-7
Original file line numberDiff line numberDiff line change
@@ -861,21 +861,19 @@ def wait_next_action_
861861
step_tp iter do |event|
862862
next if event == :line && skip_line
863863

864-
loc = caller_locations(2, 1).first
865-
loc_path = loc.absolute_path || "!eval:#{loc.path}"
866-
867864
stack_depth = DEBUGGER__.frame_depth - 3
868865

869866
# If we're at a deeper stack depth, we can skip line events until there's a return event.
870867
skip_line = event == :line && stack_depth > depth
871868

872869
# same stack depth
873-
(stack_depth <= depth) ||
870+
next true if stack_depth <= depth
871+
872+
loc = caller_locations(2, 1).first
873+
loc_path = loc.absolute_path || "!eval:#{loc.path}"
874874

875875
# different frame
876-
(next_line && loc_path == path &&
877-
(loc_lineno = loc.lineno) > line &&
878-
loc_lineno <= next_line)
876+
next_line && loc_path == path && loc.lineno.between?(line + 1, next_line)
879877
end
880878
break
881879

0 commit comments

Comments
 (0)