Skip to content

Commit 5bc673d

Browse files
[MCParser] Avoid repeated hash lookups (NFC) (#110204)
1 parent 312c1cf commit 5bc673d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/MC/MCParser/MasmParser.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,7 @@ class MasmParser : public MCAsmParser {
479479
void addDirectiveHandler(StringRef Directive,
480480
ExtensionDirectiveHandler Handler) override {
481481
ExtensionDirectiveMap[Directive] = Handler;
482-
if (!DirectiveKindMap.contains(Directive)) {
483-
DirectiveKindMap[Directive] = DK_HANDLER_DIRECTIVE;
484-
}
482+
DirectiveKindMap.try_emplace(Directive, DK_HANDLER_DIRECTIVE);
485483
}
486484

487485
void addAliasForDirective(StringRef Directive, StringRef Alias) override {

0 commit comments

Comments
 (0)