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 {
4242
4343 // If the ParentPath has not yet been resolved, resolve and cache it for
4444 // future look-ups.
45- if (!ResolvedPaths.count (ParentPath)) {
45+ auto [It, Inserted] = ResolvedPaths.try_emplace (ParentPath);
46+ if (Inserted) {
4647 SmallString<256 > RealPath;
4748 sys::fs::real_path (ParentPath, RealPath);
48- ResolvedPaths.insert (
49- {ParentPath, std::string (RealPath.c_str (), RealPath.size ())});
49+ It->second = std::string (RealPath);
5050 }
5151
5252 // Join the file name again with the resolved path.
53- SmallString<256 > ResolvedPath (ResolvedPaths[ParentPath] );
53+ SmallString<256 > ResolvedPath (It-> second );
5454 sys::path::append (ResolvedPath, FileName);
5555 return StringPool.internString (ResolvedPath);
5656 }
You can’t perform that action at this time.
0 commit comments