diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-01-09 19:04:23 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-09 19:04:23 +0000 |
commit | 1cfb14aa972ccf3235ac67f07b7db1175b7c5384 (patch) | |
tree | b746eda548993b9e0987d7c9c0c543ddddc5758f /src/edit.c | |
parent | 765d82a657c5e42d5d7c88ae410e53f398c34c43 (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/edit.c')
-rw-r--r-- | src/edit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/edit.c b/src/edit.c index 4a89fe13fb..983f1aca6d 100644 --- a/src/edit.c +++ b/src/edit.c @@ -2970,12 +2970,12 @@ get_last_insert_save(void) if (last_insert == NULL) return NULL; s = vim_strsave(last_insert + last_insert_skip); - if (s != NULL) - { - len = (int)STRLEN(s); - if (len > 0 && s[len - 1] == ESC) // remove trailing ESC - s[len - 1] = NUL; - } + if (s == NULL) + return NULL; + + len = (int)STRLEN(s); + if (len > 0 && s[len - 1] == ESC) // remove trailing ESC + s[len - 1] = NUL; return s; } |