diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-04-04 14:27:15 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-11 12:57:59 -0300 |
commit | b8bda77e39a8c9a64348f28993425c4b801458b6 (patch) | |
tree | 5e91479836059d046ff9d38e985b631711943069 /src | |
parent | 86279cefae74ead8c740575d294ef06e12aa7da8 (diff) | |
download | rneovim-b8bda77e39a8c9a64348f28993425c4b801458b6.tar.gz rneovim-b8bda77e39a8c9a64348f28993425c4b801458b6.tar.bz2 rneovim-b8bda77e39a8c9a64348f28993425c4b801458b6.zip |
Remove OOM error handling code after calls to diff_alloc_new()
Diffstat (limited to 'src')
-rw-r--r-- | src/diff.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/diff.c b/src/diff.c index 90bdbf0850..392fef00c9 100644 --- a/src/diff.c +++ b/src/diff.c @@ -266,10 +266,6 @@ static void diff_mark_adjust_tp(tabpage_T *tp, int idx, linenr_T line1, && !diff_busy) { diff_T *dnext = diff_alloc_new(tp, dprev, dp); - if (dnext == NULL) { - return; - } - dnext->df_lnum[idx] = line1; dnext->df_count[idx] = inserted; int i; @@ -467,14 +463,14 @@ static void diff_mark_adjust_tp(tabpage_T *tp, int idx, linenr_T line1, static diff_T* diff_alloc_new(tabpage_T *tp, diff_T *dprev, diff_T *dp) { diff_T *dnew = (diff_T *)alloc((unsigned)sizeof(diff_T)); - if (dnew != NULL) { - dnew->df_next = dp; - if (dprev == NULL) { - tp->tp_first_diff = dnew; - } else { - dprev->df_next = dnew; - } + + dnew->df_next = dp; + if (dprev == NULL) { + tp->tp_first_diff = dnew; + } else { + dprev->df_next = dnew; } + return dnew; } @@ -1372,9 +1368,6 @@ static void diff_read(int idx_orig, int idx_new, char_u *fname) } else { // Allocate a new diffblock. dp = diff_alloc_new(curtab, dprev, dp); - if (dp == NULL) { - goto done; - } dp->df_lnum[idx_orig] = lnum_orig; dp->df_count[idx_orig] = count_orig; |