[clang-tidy] use emplace_back

Found with hicpp-use-emplace

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-02-20 22:51:01 -08:00 committed by Fabian Homborg
parent 1f01423f46
commit aff6a74770
2 changed files with 5 additions and 5 deletions

View File

@ -285,11 +285,11 @@ static int fish_parse_opt(int argc, char **argv, fish_cmd_opts_t *opts) {
while ((opt = getopt_long(argc, argv, short_opts, long_opts, nullptr)) != -1) {
switch (opt) {
case 'c': {
opts->batch_cmds.push_back(optarg);
opts->batch_cmds.emplace_back(optarg);
break;
}
case 'C': {
opts->postconfig_cmds.push_back(optarg);
opts->postconfig_cmds.emplace_back(optarg);
break;
}
case 'd': {
@ -315,7 +315,7 @@ static int fish_parse_opt(int argc, char **argv, fish_cmd_opts_t *opts) {
break;
}
case 'h': {
opts->batch_cmds.push_back("__fish_print_help fish");
opts->batch_cmds.emplace_back("__fish_print_help fish");
break;
}
case 'i': {

View File

@ -486,7 +486,7 @@ class parse_ll_t {
while (idx--) {
production_element_t elem = production[idx];
PARSE_ASSERT(production_element_is_valid(elem));
symbol_stack.push_back(parse_stack_element_t(elem, child_start + idx));
symbol_stack.emplace_back(elem, child_start + idx);
}
}
@ -731,7 +731,7 @@ void parse_ll_t::reset_symbols(enum parse_token_type_t goal) {
nodes.push_back(parse_node_t(goal));
symbol_stack.clear();
symbol_stack.push_back(parse_stack_element_t(goal, where)); // goal token
symbol_stack.emplace_back(goal, where); // goal token
this->fatal_errored = false;
}