From 24c144e4f672e33695e228260a182b3f60e2694c Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Fri, 6 Dec 2013 16:26:55 +0000 Subject: [PATCH] Tweak the ordering of a conditional to possibly avoid a few strcmps. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196584 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/PPMacroExpansion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 954abe25d8..49acd2515d 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -1048,7 +1048,7 @@ static bool HasExtension(const Preprocessor &PP, const IdentifierInfo *II) { static bool HasAttribute(const IdentifierInfo *II) { StringRef Name = II->getName(); // Normalize the attribute name, __foo__ becomes foo. - if (Name.startswith("__") && Name.endswith("__") && Name.size() >= 4) + if (Name.size() >= 4 && Name.startswith("__") && Name.endswith("__")) Name = Name.substr(2, Name.size() - 4); // FIXME: Do we need to handle namespaces here? -- 2.50.1