diff --git a/src/builtin_wait.cpp b/src/builtin_wait.cpp index f4cf2fa3b..beeafb1bc 100644 --- a/src/builtin_wait.cpp +++ b/src/builtin_wait.cpp @@ -145,7 +145,7 @@ static bool find_job_by_name(const wchar_t *proc, std::vector &ids, bool found = false; for (const auto &j : parser.jobs()) { - if (j->command_is_empty()) continue; + if (j->command().empty()) continue; if (match_pid(j->command(), proc)) { if (!contains(ids, j->job_id)) { diff --git a/src/proc.h b/src/proc.h index d3d3e6455..166085acb 100644 --- a/src/proc.h +++ b/src/proc.h @@ -322,9 +322,6 @@ class job_t { std::shared_ptr parent); ~job_t(); - /// Returns whether the command is empty. - bool command_is_empty() const { return command_str.empty(); } - /// Returns the command as a wchar_t *. */ const wchar_t *command_wcstr() const { return command_str.c_str(); } @@ -332,7 +329,7 @@ class job_t { const wcstring &command() const { return command_str; } /// Sets the command. - void set_command(const wcstring &cmd) { command_str = cmd; } + void set_command(wcstring cmd) { command_str = std::move(cmd); } /// \return whether it is OK to reap a given process. Sometimes we want to defer reaping a /// process if it is the group leader and the job is not yet constructed, because then we might