AttributeList: tweak the conditional order to avoid two strcmps

llvm-svn: 196518
This commit is contained in:
Alp Toker 2013-12-05 18:04:42 +00:00
parent 5a22df498e
commit a31d1dd179
1 changed files with 2 additions and 2 deletions

View File

@ -122,8 +122,8 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name,
StringRef AttrName = Name->getName();
// Normalize the attribute name, __foo__ becomes foo.
if (AttrName.startswith("__") && AttrName.endswith("__") &&
AttrName.size() >= 4)
if (AttrName.size() >= 4 && AttrName.startswith("__") &&
AttrName.endswith("__"))
AttrName = AttrName.substr(2, AttrName.size() - 4);
SmallString<64> Buf;