1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[llvm-cov] Clean up an awkward capture-by-reference (NFC)

Writing `for (StringRef &SourceFile : ...)` is strange to begin with.
Subsequently capturing "SourceFile" by reference is even stranger. Just
copy the StringRef, since that's cheap to do.

llvm-svn: 275515
This commit is contained in:
Vedant Kumar 2016-07-15 01:19:35 +00:00
parent 493ce5ef6c
commit fe8fff3fe2

View File

@ -551,8 +551,8 @@ int CodeCoverageTool::show(int argc, const char **argv,
ThreadCount = std::thread::hardware_concurrency();
ThreadPool Pool(ThreadCount);
for (StringRef &SourceFile : SourceFiles) {
Pool.async([this, &SourceFile, &Coverage, &Printer, ShowFilenames] {
for (StringRef SourceFile : SourceFiles) {
Pool.async([this, SourceFile, &Coverage, &Printer, ShowFilenames] {
auto View = createSourceFileView(SourceFile, *Coverage);
if (!View) {
deferWarning("The file '" + SourceFile.str() + "' isn't covered.");