From cc2b0d58da14fe800ce338bd6a60fdd1469d0e20 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196518 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/AttributeList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.40.0