File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
llvm/include/llvm/DWARFLinker/Classic Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,15 @@ class CachedPathResolver {
42
42
43
43
// If the ParentPath has not yet been resolved, resolve and cache it for
44
44
// future look-ups.
45
- if (!ResolvedPaths.count (ParentPath)) {
45
+ auto [It, Inserted] = ResolvedPaths.try_emplace (ParentPath);
46
+ if (Inserted) {
46
47
SmallString<256 > RealPath;
47
48
sys::fs::real_path (ParentPath, RealPath);
48
- ResolvedPaths.insert (
49
- {ParentPath, std::string (RealPath.c_str (), RealPath.size ())});
49
+ It->second = std::string (RealPath);
50
50
}
51
51
52
52
// Join the file name again with the resolved path.
53
- SmallString<256 > ResolvedPath (ResolvedPaths[ParentPath] );
53
+ SmallString<256 > ResolvedPath (It-> second );
54
54
sys::path::append (ResolvedPath, FileName);
55
55
return StringPool.internString (ResolvedPath);
56
56
}
You can’t perform that action at this time.
0 commit comments