patch 9.0.1132: code is indented more than needed
Problem: Code is indented more than needed.
Solution: Use an early return to reduce indentation. (Yegappan Lakshmanan,
closes #11769)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 4884ebd..49331c4 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4210,11 +4210,11 @@
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = alloc(2);
- if (rettv->vval.v_string != NULL)
- {
- rettv->vval.v_string[0] = get_cmdline_type();
- rettv->vval.v_string[1] = NUL;
- }
+ if (rettv->vval.v_string == NULL)
+ return;
+
+ rettv->vval.v_string[0] = get_cmdline_type();
+ rettv->vval.v_string[1] = NUL;
}
// Set the command line str to "str".