[llvm] 09d945d - [ProfileData] Avoid repeated hash lookups (NFC) (#125464)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 12:30:12 PST 2025


Author: Kazu Hirata
Date: 2025-02-03T12:30:09-08:00
New Revision: 09d945d6e4e5e845fa84d30572fac9e816faccc1

URL: https://github.com/llvm/llvm-project/commit/09d945d6e4e5e845fa84d30572fac9e816faccc1
DIFF: https://github.com/llvm/llvm-project/commit/09d945d6e4e5e845fa84d30572fac9e816faccc1.diff

LOG: [ProfileData] Avoid repeated hash lookups (NFC) (#125464)

Added: 
    

Modified: 
    llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
index 5a20a9ef63287e..4fc0133443192d 100644
--- a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
+++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
@@ -541,9 +541,9 @@ struct MCDCRecord {
 
   std::string getConditionHeaderString(unsigned Condition) {
     std::ostringstream OS;
-    OS << "Condition C" << Condition + 1 << " --> (";
-    OS << CondLoc[Condition].first << ":" << CondLoc[Condition].second;
-    OS << ")\n";
+    const auto &[Line, Col] = CondLoc[Condition];
+    OS << "Condition C" << Condition + 1 << " --> (" << Line << ":" << Col
+       << ")\n";
     return OS.str();
   }
 


        


More information about the llvm-commits mailing list