diff options
author | K.Takata <kentkt@csc.jp> | 2021-06-02 13:28:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-06-02 13:28:16 +0200 |
commit | eeec2548785b2dd245a31ab25d7bde0f88ea1a6d (patch) | |
tree | 533236c436888fd7a072c4d94a75279158f9c8a5 /src/evalfunc.c | |
parent | b54abeeafb074248597878a874fed9a66b114c06 (diff) |
patch 8.2.2922: computing array length is done in various waysv8.2.2922
Problem: Computing array length is done in various ways.
Solution: Use ARRAY_LENGTH everywhere. (Ken Takata, closes #8305)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 16447aba25..fcb64f67ac 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1877,7 +1877,7 @@ get_function_name(expand_T *xp, int idx) return name; } } - if (++intidx < (int)(sizeof(global_functions) / sizeof(funcentry_T))) + if (++intidx < (int)ARRAY_LENGTH(global_functions)) { STRCPY(IObuff, global_functions[intidx].f_name); STRCAT(IObuff, "("); @@ -1923,7 +1923,7 @@ find_internal_func_opt(char_u *name, int implemented) int cmp; int x; - last = (int)(sizeof(global_functions) / sizeof(funcentry_T)) - 1; + last = (int)ARRAY_LENGTH(global_functions) - 1; // Find the function name in the table. Binary search. while (first <= last) |