eval/typval: Convert string to varnumber_T instead of intermediate long

This commit is contained in:
James McCoy 2017-06-06 07:56:03 -04:00
parent 6757c503bd
commit 2109fb18e6
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -2405,9 +2405,7 @@ varnumber_T tv_get_number_chk(const typval_T *const tv, bool *const ret_error)
case VAR_STRING: {
varnumber_T n = 0;
if (tv->vval.v_string != NULL) {
long nr;
vim_str2nr(tv->vval.v_string, NULL, NULL, STR2NR_ALL, &nr, NULL, 0);
n = (varnumber_T)nr;
vim_str2nr(tv->vval.v_string, NULL, NULL, STR2NR_ALL, &n, NULL, 0);
}
return n;
}