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/diff.c b/src/diff.c
index 41cfefe..ec8c8f1 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -559,14 +559,14 @@
diff_T *dnew;
dnew = ALLOC_ONE(diff_T);
- if (dnew != NULL)
- {
- dnew->df_next = dp;
- if (dprev == NULL)
- tp->tp_first_diff = dnew;
- else
- dprev->df_next = dnew;
- }
+ if (dnew == NULL)
+ return NULL;
+
+ dnew->df_next = dp;
+ if (dprev == NULL)
+ tp->tp_first_diff = dnew;
+ else
+ dprev->df_next = dnew;
return dnew;
}