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/highlight.c | |
parent | b54abeeafb074248597878a874fed9a66b114c06 (diff) | |
download | vim-git-eeec2548785b2dd245a31ab25d7bde0f88ea1a6d.tar.gz |
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/highlight.c')
-rw-r--r-- | src/highlight.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/highlight.c b/src/highlight.c index 56b198883..defbe5517 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -998,7 +998,7 @@ do_highlight( off = 0; while (arg[off] != NUL) { - for (i = sizeof(hl_attr_table) / sizeof(int); --i >= 0; ) + for (i = ARRAY_LENGTH(hl_attr_table); --i >= 0; ) { len = (int)STRLEN(hl_name_table[i]); if (STRNICMP(arg + off, hl_name_table[i], len) == 0) @@ -1168,7 +1168,7 @@ do_highlight( // reduce calls to STRICMP a bit, it can be slow off = TOUPPER_ASC(*arg); - for (i = (sizeof(color_names) / sizeof(char *)); --i >= 0; ) + for (i = ARRAY_LENGTH(color_names); --i >= 0; ) if (off == color_names[i][0] && STRICMP(arg + 1, color_names[i] + 1) == 0) break; |