summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2013-12-05 18:04:42 +0000
committerAlp Toker <alp@nuanti.com>2013-12-05 18:04:42 +0000
commita31d1dd179e8a40982b723b7070f1724c51e6224 (patch)
tree4ee5237c99984d1a80a7045720de444ebc56d581 /clang/lib/Sema
parent5a22df498e856b96018d66cdaeeb2e4c27be7b6b (diff)
downloadbcm5719-llvm-a31d1dd179e8a40982b723b7070f1724c51e6224.tar.gz
bcm5719-llvm-a31d1dd179e8a40982b723b7070f1724c51e6224.zip
AttributeList: tweak the conditional order to avoid two strcmps
llvm-svn: 196518
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/AttributeList.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/AttributeList.cpp b/clang/lib/Sema/AttributeList.cpp
index aa7f9df6bca..023069c35b8 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;
OpenPOWER on IntegriCloud