CustomPipeline: Make use of emplace_back() in GlobalConflicts()

We can use the string_view arguments to directly construct strings
inside of the global_result vector.
This commit is contained in:
Lioncash 2024-01-31 22:53:42 -05:00
parent 353ceedb50
commit 59211589b9
1 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ std::vector<std::string> GlobalConflicts(std::string_view source)
{ {
i++; i++;
} }
global_result.push_back(std::string{parse_identifier()}); global_result.emplace_back(parse_identifier());
parse_until_end_of_preprocessor(); parse_until_end_of_preprocessor();
} }
else else
@ -121,11 +121,11 @@ std::vector<std::string> GlobalConflicts(std::string_view source)
// Since we handle equality, we can assume the identifier // Since we handle equality, we can assume the identifier
// before '(' is a function definition // before '(' is a function definition
global_result.push_back(std::string{last_identifier}); global_result.emplace_back(last_identifier);
} }
else if (source[i] == '=') else if (source[i] == '=')
{ {
global_result.push_back(std::string{last_identifier}); global_result.emplace_back(last_identifier);
i++; i++;
for (; i < source.size(); i++) for (; i < source.size(); i++)
{ {