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 {
627627
628628SymIndexId
629629SymbolCache::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)
632633 return Iter->second ;
633634
634635 SymIndexId Id = SourceFiles.size ();
635636 auto SrcFile = std::make_unique<NativeSourceFile>(Session, Id, Checksums);
636637 SourceFiles.push_back (std::move (SrcFile));
637- FileNameOffsetToId[Checksums. FileNameOffset ] = Id;
638+ Iter-> second = Id;
638639 return Id;
639640}
640641
You can’t perform that action at this time.
0 commit comments