From 59b63f3aab3b39704279cd29addb16b654219602 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 23 Oct 2021 10:10:26 -0700 Subject: [PATCH] Use vec_append when expanding a command into arguments This saves some lines and some allocations. --- src/parse_execution.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index 7406d52de..3b249540b 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -893,8 +893,7 @@ end_execution_reason_t parse_execution_context_t::populate_plain_process( // from expanding the command, followed by the argument nodes themselves. E.g. if the // command is '$gco foo' and $gco is git checkout. cmd_args.push_back(cmd); - cmd_args.insert(cmd_args.end(), args_from_cmd_expansion.begin(), - args_from_cmd_expansion.end()); + vec_append(cmd_args, std::move(args_from_cmd_expansion)); ast_args_list_t arg_nodes = get_argument_nodes(statement.args_or_redirs); end_execution_reason_t arg_result =