llvm.org GIT mirror llvm / b9d9ab2
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275515 91177308-0d34-0410-b5e6-96231b3b80d8 Vedant Kumar 4 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
550550 ThreadCount = std::thread::hardware_concurrency();
551551 ThreadPool Pool(ThreadCount);
552552
553 for (StringRef &SourceFile : SourceFiles) {
554 Pool.async([this, &SourceFile, &Coverage, &Printer, ShowFilenames] {
553 for (StringRef SourceFile : SourceFiles) {
554 Pool.async([this, SourceFile, &Coverage, &Printer, ShowFilenames] {
555555 auto View = createSourceFileView(SourceFile, *Coverage);
556556 if (!View) {
557557 deferWarning("The file '" + SourceFile.str() + "' isn't covered.");