diff options
author | Andreas Kling <kling@serenityos.org> | 2023-03-06 14:17:01 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-06 23:46:35 +0100 |
commit | 8a48246ed1a93983668a25f5b9b0af0e745e3f04 (patch) | |
tree | dd98425d119f79e0160bf19951f96a4a30276cbb /Userland/Shell/Builtin.cpp | |
parent | 104be6c8ace8d56f66a89b570cdd615e74d22aa8 (diff) | |
download | serenity-8a48246ed1a93983668a25f5b9b0af0e745e3f04.zip |
Everywhere: Stop using NonnullRefPtrVector
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.
This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
Diffstat (limited to 'Userland/Shell/Builtin.cpp')
-rw-r--r-- | Userland/Shell/Builtin.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Shell/Builtin.cpp b/Userland/Shell/Builtin.cpp index ea5ab7db1c..d9cc2a60ce 100644 --- a/Userland/Shell/Builtin.cpp +++ b/Userland/Shell/Builtin.cpp @@ -1014,7 +1014,7 @@ ErrorOr<int> Shell::builtin_time(Main::Arguments arguments) auto timer = Core::ElapsedTimer::start_new(); for (auto& job : run_commands(commands)) { block_on_job(job); - exit_code = job.exit_code(); + exit_code = job->exit_code(); } iteration_times.add(static_cast<float>(timer.elapsed())); } @@ -1190,7 +1190,7 @@ ErrorOr<int> Shell::builtin_not(Main::Arguments arguments) for (auto& job : run_commands(commands)) { found_a_job = true; block_on_job(job); - exit_code = job.exit_code(); + exit_code = job->exit_code(); } // In case it was a function. if (!found_a_job) @@ -1242,7 +1242,7 @@ ErrorOr<int> Shell::builtin_kill(Main::Arguments arguments) return exit_code; } -ErrorOr<bool> Shell::run_builtin(const AST::Command& command, NonnullRefPtrVector<AST::Rewiring> const& rewirings, int& retval) +ErrorOr<bool> Shell::run_builtin(const AST::Command& command, Vector<NonnullRefPtr<AST::Rewiring>> const& rewirings, int& retval) { if (command.argv.is_empty()) return false; @@ -1266,7 +1266,7 @@ ErrorOr<bool> Shell::run_builtin(const AST::Command& command, NonnullRefPtrVecto SavedFileDescriptors fds { rewirings }; for (auto& rewiring : rewirings) { - int rc = dup2(rewiring.old_fd, rewiring.new_fd); + int rc = dup2(rewiring->old_fd, rewiring->new_fd); if (rc < 0) { perror("dup2(run)"); return false; |