tweaks: avoid parsing the same character twice
Also, make the second loop similar in form to the first.master
parent
b58418b32f
commit
1c3953705c
|
@ -644,8 +644,8 @@ bool has_blank_char(const char *s)
|
||||||
if (use_utf8) {
|
if (use_utf8) {
|
||||||
char symbol[MAXCHARLEN];
|
char symbol[MAXCHARLEN];
|
||||||
|
|
||||||
for (; *s != '\0'; s += move_mbright(s, 0)) {
|
while (*s != '\0') {
|
||||||
parse_mbchar(s, symbol, NULL);
|
s += parse_mbchar(s, symbol, NULL);
|
||||||
|
|
||||||
if (is_blank_mbchar(symbol))
|
if (is_blank_mbchar(symbol))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -653,9 +653,10 @@ bool has_blank_char(const char *s)
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
for (; *s != '\0'; s++) {
|
while (*s != '\0') {
|
||||||
if (isblank((unsigned char)*s))
|
if (isblank((unsigned char)*s))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
s++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue