Skip to content

Commit 157adcc

Browse files
[GSYM] Avoid repeated hash lookups (NFC) (#109241)
1 parent 72fd35b commit 157adcc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/DebugInfo/GSYM/GsymCreator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ uint32_t GsymCreator::insertString(StringRef S, bool Copy) {
375375
// Save a mapping of string offsets to the cached string reference in case
376376
// we need to segment the GSYM file and copy string from one string table to
377377
// another.
378-
if (StringOffsetMap.count(StrOff) == 0)
379-
StringOffsetMap.insert(std::make_pair(StrOff, CHStr));
378+
StringOffsetMap.try_emplace(StrOff, CHStr);
380379
return StrOff;
381380
}
382381

0 commit comments

Comments
 (0)