mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 11:16:06 +00:00
Simplify. NFC.
llvm-svn: 262027
This commit is contained in:
parent
72acaa1d17
commit
dad77c593b
@ -33,9 +33,8 @@ static bool isAlnum(char C) { return isAlpha(C) || ('0' <= C && C <= '9'); }
|
||||
|
||||
// Returns true if S is valid as a C language identifier.
|
||||
bool elf2::isValidCIdentifier(StringRef S) {
|
||||
if (S.empty() || !isAlpha(S[0]))
|
||||
return false;
|
||||
return std::all_of(S.begin() + 1, S.end(), isAlnum);
|
||||
return !S.empty() && isAlpha(S[0]) &&
|
||||
std::all_of(S.begin() + 1, S.end(), isAlnum);
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
|
Loading…
x
Reference in New Issue
Block a user