mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
Use move semantics in builtin_eval
Saves some allocations
This commit is contained in:
parent
c95e1b83c7
commit
4e1fdaf5a7
@ -32,7 +32,7 @@ int builtin_eval(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||||||
|
|
||||||
int status = STATUS_CMD_OK;
|
int status = STATUS_CMD_OK;
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
if (parser.eval(new_cmd.c_str(), *streams.io_chain, block_type_t::TOP) != 0) {
|
if (parser.eval(std::move(new_cmd), *streams.io_chain, block_type_t::TOP) != 0) {
|
||||||
// This indicates a parse error; nothing actually got executed.
|
// This indicates a parse error; nothing actually got executed.
|
||||||
status = STATUS_CMD_ERROR;
|
status = STATUS_CMD_ERROR;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user