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,
645
645
646
646
// For an #undef'd macro, we only care about the name.
647
647
if (IsUndef) {
648
- if (MacroNames && !Macros.count (MacroName))
648
+ auto [It, Inserted] = Macros.try_emplace (MacroName);
649
+ if (MacroNames && Inserted)
649
650
MacroNames->push_back (MacroName);
650
651
651
- Macros[MacroName] = std::make_pair (" " , true );
652
+ It-> second = std::make_pair (" " , true );
652
653
continue ;
653
654
}
654
655
@@ -661,9 +662,10 @@ collectMacroDefinitions(const PreprocessorOptions &PPOpts,
661
662
MacroBody = MacroBody.substr (0 , End);
662
663
}
663
664
664
- if (MacroNames && !Macros.count (MacroName))
665
+ auto [It, Inserted] = Macros.try_emplace (MacroName);
666
+ if (MacroNames && Inserted)
665
667
MacroNames->push_back (MacroName);
666
- Macros[MacroName] = std::make_pair (MacroBody, false );
668
+ It-> second = std::make_pair (MacroBody, false );
667
669
}
668
670
}
669
671
You can’t perform that action at this time.
0 commit comments