0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.4431: unnecessary condition when assigning to a variable

Problem:    Unnecessary condition when assigning to a variable.
Solution:   Remove the condition.
This commit is contained in:
Bram Moolenaar
2022-02-21 15:59:11 +00:00
parent 101979358f
commit 993faa3405
2 changed files with 156 additions and 158 deletions

View File

@@ -3409,7 +3409,7 @@ set_var_const(
type_T *type = type_arg; type_T *type = type_arg;
typval_T bool_tv; typval_T bool_tv;
dictitem_T *di; dictitem_T *di;
typval_T *dest_tv = NULL; typval_T *dest_tv;
char_u *varname; char_u *varname;
char_u *name_tofree = NULL; char_u *name_tofree = NULL;
hashtab_T *ht = NULL; hashtab_T *ht = NULL;
@@ -3503,8 +3503,6 @@ set_var_const(
} }
} }
if (dest_tv == NULL)
{
// Search in parent scope which is possible to reference from lambda // Search in parent scope which is possible to reference from lambda
if (di == NULL) if (di == NULL)
di = find_var_in_scoped_ht(name, TRUE); di = find_var_in_scoped_ht(name, TRUE);
@@ -3680,8 +3678,6 @@ set_var_const(
} }
dest_tv = &di->di_tv; dest_tv = &di->di_tv;
}
if (copy || tv->v_type == VAR_NUMBER || tv->v_type == VAR_FLOAT) if (copy || tv->v_type == VAR_NUMBER || tv->v_type == VAR_FLOAT)
copy_tv(tv, dest_tv); copy_tv(tv, dest_tv);
else else

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
4431,
/**/ /**/
4430, 4430,
/**/ /**/