diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-01-26 21:08:52 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-01-26 21:08:52 -0500 |
commit | 6bc8c7be3a808f66d2c47bfe463a1346490da7f4 (patch) | |
tree | 80d0fde12c759fa9e64e40fae2c2bcad13591398 /src/nvim/eval.c | |
parent | 75a1006a20c5be7add44ed709ad34ae9fb3fce7b (diff) | |
parent | 5deb06597ce72470a5cc86d4f52ee9b025288228 (diff) | |
download | rneovim-6bc8c7be3a808f66d2c47bfe463a1346490da7f4.tar.gz rneovim-6bc8c7be3a808f66d2c47bfe463a1346490da7f4.tar.bz2 rneovim-6bc8c7be3a808f66d2c47bfe463a1346490da7f4.zip |
Merge pull request #1867 from elmart/nonnull-deadcode
Remove deadcode due to nonnullret funcs.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 87a5ed80e7..a4bd4d89ef 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -11628,18 +11628,12 @@ static void f_or(typval_T *argvars, typval_T *rettv) */ static void f_pathshorten(typval_T *argvars, typval_T *rettv) { - char_u *p; - rettv->v_type = VAR_STRING; - p = get_tv_string_chk(&argvars[0]); - if (p == NULL) - rettv->vval.v_string = NULL; - else { - p = vim_strsave(p); - rettv->vval.v_string = p; - if (p != NULL) - shorten_dir(p); + rettv->vval.v_string = get_tv_string_chk(&argvars[0]); + if (!rettv->vval.v_string) { + return; } + rettv->vval.v_string = shorten_dir(vim_strsave(rettv->vval.v_string)); } /* @@ -18168,8 +18162,7 @@ void func_dump_profile(FILE *fd) --todo; fp = HI2UF(hi); if (fp->uf_profiling) { - if (sorttab != NULL) - sorttab[st_len++] = fp; + sorttab[st_len++] = fp; if (fp->uf_name[0] == K_SPECIAL) fprintf(fd, "FUNCTION <SNR>%s()\n", fp->uf_name + 3); @@ -18196,7 +18189,7 @@ void func_dump_profile(FILE *fd) } } - if (sorttab != NULL && st_len > 0) { + if (st_len > 0) { qsort((void *)sorttab, (size_t)st_len, sizeof(ufunc_T *), prof_total_cmp); prof_sort_list(fd, sorttab, st_len, "TOTAL", FALSE); |