File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
llvm/lib/DebugInfo/PDB/Native Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -627,14 +627,15 @@ SymbolCache::getSourceFileById(SymIndexId FileId) const {
627
627
628
628
SymIndexId
629
629
SymbolCache::getOrCreateSourceFile (const FileChecksumEntry &Checksums) const {
630
- auto Iter = FileNameOffsetToId.find (Checksums.FileNameOffset );
631
- if (Iter != FileNameOffsetToId.end ())
630
+ auto [Iter, Inserted] =
631
+ FileNameOffsetToId.try_emplace (Checksums.FileNameOffset );
632
+ if (!Inserted)
632
633
return Iter->second ;
633
634
634
635
SymIndexId Id = SourceFiles.size ();
635
636
auto SrcFile = std::make_unique<NativeSourceFile>(Session, Id, Checksums);
636
637
SourceFiles.push_back (std::move (SrcFile));
637
- FileNameOffsetToId[Checksums. FileNameOffset ] = Id;
638
+ Iter-> second = Id;
638
639
return Id;
639
640
}
640
641
You can’t perform that action at this time.
0 commit comments