Simplify. NFC.

llvm-svn: 262027
This commit is contained in:
Rui Ueyama 2016-02-26 15:42:06 +00:00
parent 72acaa1d17
commit dad77c593b
1 changed files with 2 additions and 3 deletions

View File

@ -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>