Skip to content

Commit 38f8ca1

Browse files
[DebugInfo] Avoid repeated hash lookups (NFC) (#128632)
1 parent 43401dd commit 38f8ca1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,12 +721,11 @@ Error LVCodeViewReader::traverseSymbolSection(StringRef SectionName,
721721
getFileName());
722722

723723
LLVM_DEBUG({ W.printString("Symbol Name", SymbolName); });
724-
if (FunctionLineTables.count(SymbolName) != 0) {
724+
if (!FunctionLineTables.try_emplace(SymbolName, Contents).second) {
725725
// Saw debug info for this function already?
726726
return createStringError(object_error::parse_failed, getFileName());
727727
}
728728

729-
FunctionLineTables[SymbolName] = Contents;
730729
SymbolNames.push_back(SymbolName);
731730
}
732731
break;

0 commit comments

Comments
 (0)