diff options
Diffstat (limited to 'src/buildtool/common/action.hpp')
-rw-r--r-- | src/buildtool/common/action.hpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/buildtool/common/action.hpp b/src/buildtool/common/action.hpp index 350a1d2b..c134ae25 100644 --- a/src/buildtool/common/action.hpp +++ b/src/buildtool/common/action.hpp @@ -56,7 +56,9 @@ class Action { 1.0, std::map<std::string, std::string>{}) {} - [[nodiscard]] auto Id() const noexcept -> ActionIdentifier { return id_; } + [[nodiscard]] auto Id() const noexcept -> ActionIdentifier const& { + return id_; + } [[nodiscard]] auto Command() && noexcept -> std::vector<std::string> { return std::move(command_); @@ -67,10 +69,12 @@ class Action { return command_; } - [[nodiscard]] auto Cwd() const -> std::string { return cwd_; } + [[nodiscard]] auto Cwd() const noexcept -> std::string const& { + return cwd_; + } [[nodiscard]] auto Env() const& noexcept - -> std::map<std::string, std::string> { + -> std::map<std::string, std::string> const& { return env_; } @@ -78,15 +82,20 @@ class Action { return std::move(env_); } - [[nodiscard]] auto IsTreeAction() const -> bool { return is_tree_; } - [[nodiscard]] auto MayFail() const -> std::optional<std::string> { + [[nodiscard]] auto IsTreeAction() const noexcept -> bool { + return is_tree_; + } + [[nodiscard]] auto MayFail() const noexcept + -> std::optional<std::string> const& { return may_fail_; } - [[nodiscard]] auto NoCache() const -> bool { return no_cache_; } - [[nodiscard]] auto TimeoutScale() const -> double { return timeout_scale_; } + [[nodiscard]] auto NoCache() const noexcept -> bool { return no_cache_; } + [[nodiscard]] auto TimeoutScale() const noexcept -> double { + return timeout_scale_; + } [[nodiscard]] auto ExecutionProperties() const& noexcept - -> std::map<std::string, std::string> { + -> std::map<std::string, std::string> const& { return execution_properties_; } @@ -95,8 +104,8 @@ class Action { return std::move(execution_properties_); } - [[nodiscard]] static auto CreateTreeAction(ActionIdentifier const& id) - -> Action { + [[nodiscard]] static auto CreateTreeAction( + ActionIdentifier const& id) noexcept -> Action { return Action{id}; } @@ -111,7 +120,8 @@ class Action { double timeout_scale_{}; std::map<std::string, std::string> execution_properties_{}; - explicit Action(ActionIdentifier id) : id_{std::move(id)}, is_tree_{true} {} + explicit Action(ActionIdentifier id) noexcept + : id_{std::move(id)}, is_tree_{true} {} }; #endif // INCLUDED_SRC_BUILDTOOL_COMMON_ACTION_HPP |