mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 11:47:04 +08:00
[clang-tidy] use emplace_back
Found with hicpp-use-emplace Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
1f01423f46
commit
aff6a74770
|
@ -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': {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user