From 90811cb073c87e6921533fa90c881e6a0f80f7e9 Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Wed, 27 May 2015 18:11:07 +0000 Subject: Avoid creating and destroying a std::string on every iteration. llvm-svn: 238343 --- llvm/lib/Support/Debug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support') 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> 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; } -- cgit v1.2.3