0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -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

@@ -7358,7 +7358,8 @@ changedir_func(
{
char_u *pdir = NULL;
int dir_differs;
int retval = FALSE;
char_u *acmd_fname;
char_u **pp;
if (new_dir == NULL || allbuf_locked())
return FALSE;
@@ -7415,38 +7416,32 @@ changedir_func(
{
emsg(_(e_command_failed));
vim_free(pdir);
return FALSE;
}
if (scope == CDSCOPE_WINDOW)
pp = &curwin->w_prevdir;
else if (scope == CDSCOPE_TABPAGE)
pp = &curtab->tp_prevdir;
else
pp = &prev_dir;
vim_free(*pp);
*pp = pdir;
post_chdir(scope);
if (dir_differs)
{
char_u *acmd_fname;
char_u **pp;
if (scope == CDSCOPE_WINDOW)
pp = &curwin->w_prevdir;
acmd_fname = (char_u *)"window";
else if (scope == CDSCOPE_TABPAGE)
pp = &curtab->tp_prevdir;
acmd_fname = (char_u *)"tabpage";
else
pp = &prev_dir;
vim_free(*pp);
*pp = pdir;
post_chdir(scope);
if (dir_differs)
{
if (scope == CDSCOPE_WINDOW)
acmd_fname = (char_u *)"window";
else if (scope == CDSCOPE_TABPAGE)
acmd_fname = (char_u *)"tabpage";
else
acmd_fname = (char_u *)"global";
apply_autocmds(EVENT_DIRCHANGED, acmd_fname, new_dir, FALSE,
curbuf);
}
retval = TRUE;
acmd_fname = (char_u *)"global";
apply_autocmds(EVENT_DIRCHANGED, acmd_fname, new_dir, FALSE,
curbuf);
}
return retval;
return TRUE;
}
/*