From: Alp Toker Date: Thu, 5 Dec 2013 18:04:42 +0000 (+0000) Subject: AttributeList: tweak the conditional order to avoid two strcmps X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc2b0d58da14fe800ce338bd6a60fdd1469d0e20;p=clang AttributeList: tweak the conditional order to avoid two strcmps git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196518 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/AttributeList.cpp b/lib/Sema/AttributeList.cpp index aa7f9df6bc..023069c35b 100644 --- a/lib/Sema/AttributeList.cpp +++ b/lib/Sema/AttributeList.cpp @@ -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;