Mercurial > vim
comparison src/debugger.c @ 31667:b89cfd86e18e v9.0.1166
patch 9.0.1166: code is indented more than necessary
Commit: https://github.com/vim/vim/commit/1cfb14aa972ccf3235ac67f07b7db1175b7c5384
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Jan 9 19:04:23 2023 +0000
patch 9.0.1166: code is indented more than necessary
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11792)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 09 Jan 2023 20:15:03 +0100 |
parents | 6e24001000ed |
children | 4545f58c8490 |
comparison
equal
deleted
inserted
replaced
31666:feb8dcde5ff2 | 31667:b89cfd86e18e |
---|---|
313 get_maxbacktrace_level(char_u *sname) | 313 get_maxbacktrace_level(char_u *sname) |
314 { | 314 { |
315 char *p, *q; | 315 char *p, *q; |
316 int maxbacktrace = 0; | 316 int maxbacktrace = 0; |
317 | 317 |
318 if (sname != NULL) | 318 if (sname == NULL) |
319 { | 319 return 0; |
320 p = (char *)sname; | 320 |
321 while ((q = strstr(p, "..")) != NULL) | 321 p = (char *)sname; |
322 { | 322 while ((q = strstr(p, "..")) != NULL) |
323 p = q + 2; | 323 { |
324 maxbacktrace++; | 324 p = q + 2; |
325 } | 325 maxbacktrace++; |
326 } | 326 } |
327 return maxbacktrace; | 327 return maxbacktrace; |
328 } | 328 } |
329 | 329 |
330 static void | 330 static void |
484 int | 484 int |
485 dbg_check_skipped(exarg_T *eap) | 485 dbg_check_skipped(exarg_T *eap) |
486 { | 486 { |
487 int prev_got_int; | 487 int prev_got_int; |
488 | 488 |
489 if (debug_skipped) | 489 if (!debug_skipped) |
490 { | 490 return FALSE; |
491 // Save the value of got_int and reset it. We don't want a previous | 491 |
492 // interruption cause flushing the input buffer. | 492 // Save the value of got_int and reset it. We don't want a previous |
493 prev_got_int = got_int; | 493 // interruption cause flushing the input buffer. |
494 got_int = FALSE; | 494 prev_got_int = got_int; |
495 debug_breakpoint_name = debug_skipped_name; | 495 got_int = FALSE; |
496 // eap->skip is TRUE | 496 debug_breakpoint_name = debug_skipped_name; |
497 eap->skip = FALSE; | 497 // eap->skip is TRUE |
498 (void)dbg_check_breakpoint(eap); | 498 eap->skip = FALSE; |
499 eap->skip = TRUE; | 499 (void)dbg_check_breakpoint(eap); |
500 got_int |= prev_got_int; | 500 eap->skip = TRUE; |
501 return TRUE; | 501 got_int |= prev_got_int; |
502 } | 502 return TRUE; |
503 return FALSE; | |
504 } | 503 } |
505 | 504 |
506 /* | 505 /* |
507 * The list of breakpoints: dbg_breakp. | 506 * The list of breakpoints: dbg_breakp. |
508 * This is a grow-array of structs. | 507 * This is a grow-array of structs. |