Skip to content

Commit 43400b4

Browse files
committed
Merge branch 'bb/utf8-wcwidth-cleanup'
Code cleanup. * bb/utf8-wcwidth-cleanup: utf8: use ARRAY_SIZE() in git_wcwidth()
2 parents 07ff6dd + fa364ad commit 43400b4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

utf8.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,11 @@ static int git_wcwidth(ucs_char_t ch)
9595
return -1;
9696

9797
/* binary search in table of non-spacing characters */
98-
if (bisearch(ch, zero_width, sizeof(zero_width)
99-
/ sizeof(struct interval) - 1))
98+
if (bisearch(ch, zero_width, ARRAY_SIZE(zero_width) - 1))
10099
return 0;
101100

102101
/* binary search in table of double width characters */
103-
if (bisearch(ch, double_width, sizeof(double_width)
104-
/ sizeof(struct interval) - 1))
102+
if (bisearch(ch, double_width, ARRAY_SIZE(double_width) - 1))
105103
return 2;
106104

107105
return 1;

0 commit comments

Comments
 (0)