From a31d1dd179e8a40982b723b7070f1724c51e6224 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Thu, 5 Dec 2013 18:04:42 +0000 Subject: [PATCH] AttributeList: tweak the conditional order to avoid two strcmps llvm-svn: 196518 --- clang/lib/Sema/AttributeList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/Sema/AttributeList.cpp b/clang/lib/Sema/AttributeList.cpp index aa7f9df6bca7..023069c35b8a 100644 --- a/clang/lib/Sema/AttributeList.cpp +++ b/clang/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;