summaryrefslogtreecommitdiffstats
path: root/src/debugger.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-01-09 19:04:23 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-09 19:04:23 +0000
commit1cfb14aa972ccf3235ac67f07b7db1175b7c5384 (patch)
treeb746eda548993b9e0987d7c9c0c543ddddc5758f /src/debugger.c
parent765d82a657c5e42d5d7c88ae410e53f398c34c43 (diff)
patch 9.0.1166: code is indented more than necessaryv9.0.1166
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
Diffstat (limited to 'src/debugger.c')
-rw-r--r--src/debugger.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/debugger.c b/src/debugger.c
index 1352f49994..f627a9a4da 100644
--- a/src/debugger.c
+++ b/src/debugger.c
@@ -315,14 +315,14 @@ get_maxbacktrace_level(char_u *sname)
char *p, *q;
int maxbacktrace = 0;
- if (sname != NULL)
+ if (sname == NULL)
+ return 0;
+
+ p = (char *)sname;
+ while ((q = strstr(p, "..")) != NULL)
{
- p = (char *)sname;
- while ((q = strstr(p, "..")) != NULL)
- {
- p = q + 2;
- maxbacktrace++;
- }
+ p = q + 2;
+ maxbacktrace++;
}
return maxbacktrace;
}
@@ -486,21 +486,20 @@ dbg_check_skipped(exarg_T *eap)
{
int prev_got_int;
- if (debug_skipped)
- {
- // Save the value of got_int and reset it. We don't want a previous
- // interruption cause flushing the input buffer.
- prev_got_int = got_int;
- got_int = FALSE;
- debug_breakpoint_name = debug_skipped_name;
- // eap->skip is TRUE
- eap->skip = FALSE;
- (void)dbg_check_breakpoint(eap);
- eap->skip = TRUE;
- got_int |= prev_got_int;
- return TRUE;
- }
- return FALSE;
+ if (!debug_skipped)
+ return FALSE;
+
+ // Save the value of got_int and reset it. We don't want a previous
+ // interruption cause flushing the input buffer.
+ prev_got_int = got_int;
+ got_int = FALSE;
+ debug_breakpoint_name = debug_skipped_name;
+ // eap->skip is TRUE
+ eap->skip = FALSE;
+ (void)dbg_check_breakpoint(eap);
+ eap->skip = TRUE;
+ got_int |= prev_got_int;
+ return TRUE;
}
/*