diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-18 16:25:08 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-28 13:44:06 +0100 |
commit | 73736390a01d792580e9f9081676b7f2dae20ff4 (patch) | |
tree | 796283871902cd5d00d00450b7a8f54f580e2a52 | |
parent | 2097f874e71f3fad1dc722853c6b68058528b98f (diff) | |
download | justbuild-73736390a01d792580e9f9081676b7f2dae20ff4.tar.gz |
LogConfig: avoid returning constant values
...and remove an unused method.
-rw-r--r-- | src/buildtool/logging/log_config.hpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/buildtool/logging/log_config.hpp b/src/buildtool/logging/log_config.hpp index 20c579af..1fba1243 100644 --- a/src/buildtool/logging/log_config.hpp +++ b/src/buildtool/logging/log_config.hpp @@ -70,27 +70,12 @@ class LogConfig { } /// \brief Get sink instances for all configured sink factories. - /// Returns a const copy of shared_ptrs, so accessing the sinks in the - /// calling context is thread-safe. - // NOLINTNEXTLINE(readability-const-return-type) - [[nodiscard]] static auto Sinks() noexcept - -> std::vector<ILogSink::Ptr> const { + [[nodiscard]] static auto Sinks() noexcept -> std::vector<ILogSink::Ptr> { auto& data = Data(); std::lock_guard lock{data.mutex}; return data.sinks; } - /// \brief Get all configured sink factories. - /// Returns a const copy of shared_ptrs, so accessing the factories in the - /// calling context is thread-safe. - // NOLINTNEXTLINE(readability-const-return-type) - [[nodiscard]] static auto SinkFactories() noexcept - -> std::vector<LogSinkFactory> const { - auto& data = Data(); - std::lock_guard lock{data.mutex}; - return data.factories; - } - private: [[nodiscard]] static auto Data() noexcept -> ConfigData& { static ConfigData instance{}; |