Skip to content

Commit bc3c83f

Browse files
[sancov] Use heterogeneous lookups with std::map (NFC) (llvm#113406)
1 parent d6344c1 commit bc3c83f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/tools/sancov/sancov.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ readSymbolizeAndMergeCmdArguments(std::vector<std::string> FileNames) {
10491049

10501050
{
10511051
// Short name => file name.
1052-
std::map<std::string, std::string> ObjFiles;
1052+
std::map<std::string, std::string, std::less<>> ObjFiles;
10531053
std::string FirstObjFile;
10541054
std::set<std::string> CovFiles;
10551055

@@ -1066,7 +1066,7 @@ readSymbolizeAndMergeCmdArguments(std::vector<std::string> FileNames) {
10661066
CovFiles.insert(FileName);
10671067
} else {
10681068
auto ShortFileName = llvm::sys::path::filename(FileName);
1069-
if (ObjFiles.find(std::string(ShortFileName)) != ObjFiles.end()) {
1069+
if (ObjFiles.find(ShortFileName) != ObjFiles.end()) {
10701070
fail("Duplicate binary file with a short name: " + ShortFileName);
10711071
}
10721072

@@ -1089,7 +1089,7 @@ readSymbolizeAndMergeCmdArguments(std::vector<std::string> FileNames) {
10891089
FileName);
10901090
}
10911091

1092-
auto Iter = ObjFiles.find(std::string(Components[1]));
1092+
auto Iter = ObjFiles.find(Components[1]);
10931093
if (Iter == ObjFiles.end()) {
10941094
fail("Object file for coverage not found: " + FileName);
10951095
}

0 commit comments

Comments
 (0)