Skip to content

Commit 0b2ab11

Browse files
committed
Simplify implementation; NFC
Suggestion came via post-commit review feedback
1 parent 98e31b7 commit 0b2ab11

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

clang/lib/Basic/IdentifierTable.cpp

+2-16
Original file line numberDiff line numberDiff line change
@@ -251,22 +251,8 @@ static KeywordStatus getKeywordStatus(const LangOptions &LangOpts,
251251
}
252252

253253
static bool IsKeywordInCpp(unsigned Flags) {
254-
while (Flags != 0) {
255-
unsigned CurFlag = Flags & ~(Flags - 1);
256-
Flags = Flags & ~CurFlag;
257-
switch (static_cast<TokenKey>(CurFlag)) {
258-
case KEYCXX:
259-
case KEYCXX11:
260-
case KEYCXX20:
261-
case BOOLSUPPORT:
262-
case WCHARSUPPORT:
263-
case CHAR8SUPPORT:
264-
return true;
265-
default:
266-
break; // Go to the next flag, try again.
267-
}
268-
}
269-
return false;
254+
return (Flags & (KEYCXX | KEYCXX11 | KEYCXX20 | BOOLSUPPORT | WCHARSUPPORT |
255+
CHAR8SUPPORT)) != 0;
270256
}
271257

272258
static void MarkIdentifierAsKeywordInCpp(IdentifierTable &Table,

0 commit comments

Comments
 (0)