use emplace

Allows removing the constructor name as emplace forwards the arguments
directly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2021-08-04 20:50:41 -07:00
committed by Tomas Babej
parent bf93c28919
commit 5c137f5c8f
9 changed files with 24 additions and 24 deletions

View File

@@ -64,7 +64,7 @@ void Filter::subset (const std::vector <Task>& input, std::vector <Task>& output
std::vector <std::pair <std::string, Lexer::Type>> precompiled;
for (auto& a : Context::getContext ().cli2._args)
if (a.hasTag ("FILTER"))
precompiled.push_back (std::pair <std::string, Lexer::Type> (a.getToken (), a._lextype));
precompiled.emplace_back (a.getToken (), a._lextype);
if (precompiled.size ())
{
@@ -107,7 +107,7 @@ void Filter::subset (std::vector <Task>& output)
std::vector <std::pair <std::string, Lexer::Type>> precompiled;
for (auto& a : Context::getContext ().cli2._args)
if (a.hasTag ("FILTER"))
precompiled.push_back (std::pair <std::string, Lexer::Type> (a.getToken (), a._lextype));
precompiled.emplace_back (a.getToken (), a._lextype);
// Shortcut indicates that only pending.data needs to be loaded.
bool shortcut = false;