0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.2.4283: using a variable for the return value is not needed

Problem:    Using a variable for the return value is not needed.
Solution:   Return the value directly. (closes #9687)
This commit is contained in:
zeertzjq
2022-02-02 13:16:37 +00:00
committed by Bram Moolenaar
parent adbb1bf21d
commit 73257149d7
3 changed files with 30 additions and 35 deletions

View File

@@ -1903,7 +1903,6 @@ vim_chdirfile(char_u *fname, char *trigger_autocmd)
{
char_u old_dir[MAXPATHL];
char_u new_dir[MAXPATHL];
int res;
if (mch_dirname(old_dir, MAXPATHL) != OK)
*old_dir = NUL;
@@ -1913,16 +1912,15 @@ vim_chdirfile(char_u *fname, char *trigger_autocmd)
if (pathcmp((char *)old_dir, (char *)new_dir, -1) == 0)
// nothing to do
res = OK;
else
{
res = mch_chdir((char *)new_dir) == 0 ? OK : FAIL;
return OK;
if (res == OK && trigger_autocmd != NULL)
apply_autocmds(EVENT_DIRCHANGED, (char_u *)trigger_autocmd,
if (mch_chdir((char *)new_dir) != 0)
return FAIL;
if (trigger_autocmd != NULL)
apply_autocmds(EVENT_DIRCHANGED, (char_u *)trigger_autocmd,
new_dir, FALSE, curbuf);
}
return res;
return OK;
}
#endif