Skip to content

Commit 91888b2

Browse files
committed
Reduce calls to the platform strlen
Signed-off-by: Roberto Raggi <[email protected]>
1 parent fe49027 commit 91888b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/parser/cxx/preprocessor.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,15 +2674,15 @@ auto Preprocessor::Private::primaryExpression(TokList *&ts) -> long {
26742674
const auto tk = ts->tok;
26752675

26762676
if (match(ts, TokenKind::T_INTEGER_LITERAL)) {
2677-
return IntegerLiteral::Components::from(tk->text.data()).value;
2678-
} else if (matchId(ts, "true")) {
2679-
return 1;
2680-
} else if (matchId(ts, "false")) {
2681-
return 0;
2677+
return IntegerLiteral::Components::from(tk->text).value;
26822678
} else if (match(ts, TokenKind::T_LPAREN)) {
26832679
auto result = conditionalExpression(ts);
26842680
expect(ts, TokenKind::T_RPAREN);
26852681
return result;
2682+
} else if (matchId(ts, "true")) {
2683+
return 1;
2684+
} else if (matchId(ts, "false")) {
2685+
return 0;
26862686
} else if (tk->is(TokenKind::T_PP_INTERNAL_VARIABLE)) {
26872687
for (const auto &dep : dependencies_) {
26882688
if (dep.local == tk->text) {

0 commit comments

Comments
 (0)