summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
authorK.Takata <kentkt@csc.jp>2021-06-02 13:28:16 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-02 13:28:16 +0200
commiteeec2548785b2dd245a31ab25d7bde0f88ea1a6d (patch)
tree533236c436888fd7a072c4d94a75279158f9c8a5 /src/option.c
parentb54abeeafb074248597878a874fed9a66b114c06 (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/option.c')
-rw-r--r--src/option.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index 6ca424e12e..33d29a1fc4 100644
--- a/src/option.c
+++ b/src/option.c
@@ -145,7 +145,7 @@ set_init_1(int clean_arg)
opt_idx = findoption((char_u *)"backupskip");
ga_init2(&ga, 1, 100);
- for (n = 0; n < (long)(sizeof(names) / sizeof(char *)); ++n)
+ for (n = 0; n < (long)ARRAY_LENGTH(names); ++n)
{
mustfree = FALSE;
# ifdef UNIX
@@ -6317,8 +6317,7 @@ ExpandSettings(
regmatch->rm_ic = ic;
if (xp->xp_context != EXPAND_BOOL_SETTINGS)
{
- for (match = 0; match < (int)(sizeof(names) / sizeof(char *));
- ++match)
+ for (match = 0; match < (int)ARRAY_LENGTH(names); ++match)
if (vim_regexec(regmatch, (char_u *)names[match], (colnr_T)0))
{
if (loop == 0)