1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

device_mapper: slight reorder for _get_token

For most common part check for '#' when it's known it's not a space.
And also when we checked for '\n' we dont need to check again isspace().
This commit is contained in:
Zdenek Kabelac 2024-10-09 14:59:25 +02:00
parent 9b913bf950
commit 65ee09d840

View File

@ -899,16 +899,19 @@ static void _get_token(struct parser *p, int tok_prev)
static void _eat_space(struct parser *p)
{
while (p->tb != p->fe) {
if (*p->te == '#')
if (!isspace(*p->te)) {
if (*p->te != '#')
break;
while ((p->te != p->fe) && (*p->te != '\n') && (*p->te))
++p->te;
}
else if (!isspace(*p->te))
break;
while ((p->te != p->fe) && isspace(*p->te)) {
while (p->te != p->fe) {
if (*p->te == '\n')
++p->line;
else if (!isspace(*p->te))
break;
++p->te;
}