mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
eval/typval: Convert string to varnumber_T instead of intermediate long
This commit is contained in:
parent
6757c503bd
commit
2109fb18e6
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user