From: Yaron Keren Date: Wed, 27 May 2015 18:11:07 +0000 (+0000) Subject: Avoid creating and destroying a std::string on every iteration. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=fb421f446e09388b8ad2edc33d5f8dae180a7046;p=oota-llvm.git Avoid creating and destroying a std::string on every iteration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238343 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/Debug.cpp b/lib/Support/Debug.cpp index eb99242914c..47751fce3fc 100644 --- a/lib/Support/Debug.cpp +++ b/lib/Support/Debug.cpp @@ -49,9 +49,9 @@ static ManagedStatic> 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; }