File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -645,10 +645,11 @@ collectMacroDefinitions(const PreprocessorOptions &PPOpts,
645645
646646 // For an #undef'd macro, we only care about the name.
647647 if (IsUndef) {
648- if (MacroNames && !Macros.count (MacroName))
648+ auto [It, Inserted] = Macros.try_emplace (MacroName);
649+ if (MacroNames && Inserted)
649650 MacroNames->push_back (MacroName);
650651
651- Macros[MacroName] = std::make_pair (" " , true );
652+ It-> second = std::make_pair (" " , true );
652653 continue ;
653654 }
654655
@@ -661,9 +662,10 @@ collectMacroDefinitions(const PreprocessorOptions &PPOpts,
661662 MacroBody = MacroBody.substr (0 , End);
662663 }
663664
664- if (MacroNames && !Macros.count (MacroName))
665+ auto [It, Inserted] = Macros.try_emplace (MacroName);
666+ if (MacroNames && Inserted)
665667 MacroNames->push_back (MacroName);
666- Macros[MacroName] = std::make_pair (MacroBody, false );
668+ It-> second = std::make_pair (MacroBody, false );
667669 }
668670}
669671
You can’t perform that action at this time.
0 commit comments