mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
apibreak.c: simplify get_break_index()
Return directly from the loop instead of using a hit flag and separate index variable. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -65,22 +65,11 @@ static int32_t
|
||||
get_break_index(mrb_debug_context *dbg, uint32_t bpno)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t index;
|
||||
char hit = FALSE;
|
||||
|
||||
for (i = 0; i < dbg->bpnum; i++) {
|
||||
if (dbg->bp[i].bpno == bpno) {
|
||||
hit = TRUE;
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
if (dbg->bp[i].bpno == bpno) return i;
|
||||
}
|
||||
|
||||
if (hit == FALSE) {
|
||||
return MRB_DEBUG_BREAK_INVALID_NO;
|
||||
}
|
||||
|
||||
return index;
|
||||
return MRB_DEBUG_BREAK_INVALID_NO;
|
||||
}
|
||||
|
||||
static int32_t
|
||||
|
||||
Reference in New Issue
Block a user