summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-05-27 18:11:07 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-05-27 18:11:07 +0000
commit90811cb073c87e6921533fa90c881e6a0f80f7e9 (patch)
tree9dfed2fd700cdc6afc71efb6f8542d6a1222987f /llvm/lib/Support
parent2bdb4e1063f5cbc8bb1262d90cca056e9fb31fbb (diff)
downloadbcm5719-llvm-90811cb073c87e6921533fa90c881e6a0f80f7e9.tar.gz
bcm5719-llvm-90811cb073c87e6921533fa90c881e6a0f80f7e9.zip
Avoid creating and destroying a std::string on every iteration.
llvm-svn: 238343
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Debug.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Debug.cpp b/llvm/lib/Support/Debug.cpp
index eb99242914c..47751fce3fc 100644
--- a/llvm/lib/Support/Debug.cpp
+++ b/llvm/lib/Support/Debug.cpp
@@ -49,9 +49,9 @@ static ManagedStatic<std::vector<std::string>> CurrentDebugType;
bool isCurrentDebugType(const char *DebugType) {
if (CurrentDebugType->empty())
return true;
- // see if DebugType is in list. Note: do not use find() as that forces us to
+ // See if DebugType is in list. Note: do not use find() as that forces us to
// unnecessarily create an std::string instance.
- for (auto d : *CurrentDebugType) {
+ for (auto &d : *CurrentDebugType) {
if (d == DebugType)
return true;
}
OpenPOWER on IntegriCloud