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)
diff --git a/src/edit.c b/src/edit.c
index 4a89fe1..983f1ac 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -2970,12 +2970,12 @@
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;
}