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:
@@ -656,7 +656,7 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string
|
||||
while (annotations.find (name.str ()) != annotations.end ());
|
||||
|
||||
auto text = Lexer::trim (value.substr (gap + 4), "\t ");
|
||||
annotations.insert (std::make_pair (name.str (), text));
|
||||
annotations.emplace (name.str (), text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,9 +67,9 @@ int CmdGet::execute (std::string& output)
|
||||
Task t;
|
||||
Variant result;
|
||||
if (getDOM (arg.attribute ("raw"), t, result))
|
||||
results.push_back ((std::string) result);
|
||||
results.emplace_back (result);
|
||||
else
|
||||
results.push_back ("");
|
||||
results.emplace_back ("");
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user