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/ex_getln.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/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 49331c4178..2407bceb16 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4146,16 +4146,16 @@ get_cmdline_completion(void) return NULL; p = get_ccline_ptr(); - if (p != NULL && p->xpc != NULL) - { - char_u *cmd_compl; + if (p == NULL || p->xpc == NULL) + return NULL; - set_expand_context(p->xpc); + char_u *cmd_compl; - cmd_compl = cmdcomplete_type_to_str(p->xpc->xp_context); - if (cmd_compl != NULL) - return vim_strsave(cmd_compl); - } + set_expand_context(p->xpc); + + cmd_compl = cmdcomplete_type_to_str(p->xpc->xp_context); + if (cmd_compl != NULL) + return vim_strsave(cmd_compl); return NULL; } |