summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-01-09 19:04:23 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-09 19:04:23 +0000
commit1cfb14aa972ccf3235ac67f07b7db1175b7c5384 (patch)
treeb746eda548993b9e0987d7c9c0c543ddddc5758f /src/diff.c
parent765d82a657c5e42d5d7c88ae410e53f398c34c43 (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/diff.c')
-rw-r--r--src/diff.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/diff.c b/src/diff.c
index 41cfefe5e6..ec8c8f175d 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -559,14 +559,14 @@ diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp)
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;
}