mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
tracepoint_inspect: do not goto into a branch
I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
This commit is contained in:
parent
1bf0d36171
commit
2071c61e42
Notes:
git
2020-06-29 11:06:34 +09:00
1 changed files with 6 additions and 6 deletions
|
@ -1455,7 +1455,7 @@ tracepoint_inspect(rb_execution_context_t *ec, VALUE self)
|
|||
{
|
||||
VALUE sym = rb_tracearg_method_id(trace_arg);
|
||||
if (NIL_P(sym))
|
||||
goto default_inspect;
|
||||
break;
|
||||
return rb_sprintf("#<TracePoint:%"PRIsVALUE"@%"PRIsVALUE":%d in `%"PRIsVALUE"'>",
|
||||
rb_tracearg_event(trace_arg),
|
||||
rb_tracearg_path(trace_arg),
|
||||
|
@ -1477,13 +1477,13 @@ tracepoint_inspect(rb_execution_context_t *ec, VALUE self)
|
|||
rb_tracearg_event(trace_arg),
|
||||
rb_tracearg_self(trace_arg));
|
||||
default:
|
||||
default_inspect:
|
||||
break;
|
||||
}
|
||||
return rb_sprintf("#<TracePoint:%"PRIsVALUE"@%"PRIsVALUE":%d>",
|
||||
rb_tracearg_event(trace_arg),
|
||||
rb_tracearg_path(trace_arg),
|
||||
FIX2INT(rb_tracearg_lineno(trace_arg)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
return rb_sprintf("#<TracePoint:%s>", tp->tracing ? "enabled" : "disabled");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue