Revert "[clang-tidy] Replace push_back with emplace_back"

This reverts commit 897759e4dc.
This commit is contained in:
Paul Beckingham 2020-12-05 16:18:15 -05:00
parent ead50d4d6e
commit e3e158bf6a
6 changed files with 21 additions and 21 deletions

View file

@ -339,7 +339,7 @@ void CLI2::add (const std::vector <std::string>& arguments)
std::vector <A2> replacement {_original_args[0]};
for (const auto& arg : arguments)
replacement.emplace_back(arg, Lexer::Type::word);
replacement.push_back (A2 (arg, Lexer::Type::word));
for (unsigned int i = 1; i < _original_args.size (); ++i)
replacement.push_back (_original_args[i]);
@ -546,7 +546,7 @@ void CLI2::addFilter (const std::string& arg)
if (arg.length ())
{
std::vector <std::string> filter;
filter.emplace_back("(");
filter.push_back ("(");
std::string lexeme;
Lexer::Type type;
@ -555,7 +555,7 @@ void CLI2::addFilter (const std::string& arg)
while (lex.token (lexeme, type))
filter.push_back (lexeme);
filter.emplace_back(")");
filter.push_back (")");
add (filter);
analyze ();
}
@ -803,7 +803,7 @@ void CLI2::aliasExpansion ()
Lexer::Type type;
Lexer lex (_aliases[raw]);
while (lex.token (lexeme, type))
reconstructed.emplace_back(lexeme, type);
reconstructed.push_back (A2 (lexeme, type));
action = true;
changes = true;
@ -833,7 +833,7 @@ void CLI2::aliasExpansion ()
Lexer::Type type;
Lexer lex (_aliases[i.attribute ("raw")]);
while (lex.token (lexeme, type))
reconstructedOriginals.emplace_back(lexeme, type);
reconstructedOriginals.push_back (A2 (lexeme, type));
action = true;
changes = true;
@ -1483,7 +1483,7 @@ void CLI2::findIDs ()
{
changes = true;
std::string number = a.attribute ("raw");
_id_ranges.emplace_back(number, number);
_id_ranges.push_back (std::pair <std::string, std::string> (number, number));
}
}
else if (a._lextype == Lexer::Type::set)
@ -1496,9 +1496,9 @@ void CLI2::findIDs ()
changes = true;
auto hyphen = element.find ("-");
if (hyphen != std::string::npos)
_id_ranges.emplace_back(element.substr (0, hyphen), element.substr (hyphen + 1));
_id_ranges.push_back (std::pair <std::string, std::string> (element.substr (0, hyphen), element.substr (hyphen + 1)));
else
_id_ranges.emplace_back(element, element);
_id_ranges.push_back (std::pair <std::string, std::string> (element, element));
}
}
@ -1536,7 +1536,7 @@ void CLI2::findIDs ()
changes = true;
a.unTag ("MODIFICATION");
a.tag ("FILTER");
_id_ranges.emplace_back(raw, raw);
_id_ranges.push_back (std::pair <std::string, std::string> (raw, raw));
}
else if (a._lextype == Lexer::Type::set)
{
@ -1551,9 +1551,9 @@ void CLI2::findIDs ()
changes = true;
auto hyphen = element.find ("-");
if (hyphen != std::string::npos)
_id_ranges.emplace_back(element.substr (0, hyphen), element.substr (hyphen + 1));
_id_ranges.push_back (std::pair <std::string, std::string> (element.substr (0, hyphen), element.substr (hyphen + 1)));
else
_id_ranges.emplace_back(element, element);
_id_ranges.push_back (std::pair <std::string, std::string> (element, element));
}
}
}
@ -2047,7 +2047,7 @@ void CLI2::defaultCommand ()
while (lex.token (lexeme, type))
{
reconstructedOriginals.emplace_back(lexeme, type);
reconstructedOriginals.push_back (A2 (lexeme, type));
A2 cmd (lexeme, type);
cmd.tag ("DEFAULT");