Use `false` instead of `0` + conversion.
parent
467dc6ae05
commit
40f10bd28d
18
json11.cpp
18
json11.cpp
|
@ -375,38 +375,38 @@ struct JsonParser final {
|
||||||
if (str[i] == '/') {
|
if (str[i] == '/') {
|
||||||
i++;
|
i++;
|
||||||
if (i == str.size())
|
if (i == str.size())
|
||||||
return !!fail("unexpected end of input inside comment", 0);
|
return fail("unexpected end of input inside comment", false);
|
||||||
if (str[i] == '/') { // inline comment
|
if (str[i] == '/') { // inline comment
|
||||||
i++;
|
i++;
|
||||||
if (i == str.size())
|
if (i == str.size())
|
||||||
return !!fail("unexpected end of input inside inline comment", 0);
|
return fail("unexpected end of input inside inline comment", false);
|
||||||
// advance until next line
|
// advance until next line
|
||||||
while (str[i] != '\n') {
|
while (str[i] != '\n') {
|
||||||
i++;
|
i++;
|
||||||
if (i == str.size())
|
if (i == str.size())
|
||||||
return !!fail("unexpected end of input inside inline comment", 0);
|
return fail("unexpected end of input inside inline comment", false);
|
||||||
}
|
}
|
||||||
comment_found = true;
|
comment_found = true;
|
||||||
}
|
}
|
||||||
else if (str[i] == '*') { // multiline comment
|
else if (str[i] == '*') { // multiline comment
|
||||||
i++;
|
i++;
|
||||||
if (i > str.size()-2)
|
if (i > str.size()-2)
|
||||||
return !!fail("unexpected end of input inside multi-line comment", 0);
|
return fail("unexpected end of input inside multi-line comment", false);
|
||||||
// advance until closing tokens
|
// advance until closing tokens
|
||||||
while (!(str[i] == '*' && str[i+1] == '/')) {
|
while (!(str[i] == '*' && str[i+1] == '/')) {
|
||||||
i++;
|
i++;
|
||||||
if (i > str.size()-2)
|
if (i > str.size()-2)
|
||||||
return !!fail(
|
return fail(
|
||||||
"unexpected end of input inside multi-line comment", 0);
|
"unexpected end of input inside multi-line comment", false);
|
||||||
}
|
}
|
||||||
i += 2;
|
i += 2;
|
||||||
if (i == str.size())
|
if (i == str.size())
|
||||||
return !!fail(
|
return fail(
|
||||||
"unexpected end of input inside multi-line comment", 0);
|
"unexpected end of input inside multi-line comment", false);
|
||||||
comment_found = true;
|
comment_found = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return !!fail("malformed comment", 0);
|
return fail("malformed comment", false);
|
||||||
}
|
}
|
||||||
return comment_found;
|
return comment_found;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue