From 73736390a01d792580e9f9081676b7f2dae20ff4 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 18 Feb 2025 16:25:08 +0100 Subject: LogConfig: avoid returning constant values ...and remove an unused method. --- src/buildtool/logging/log_config.hpp | 17 +---------------- 1 file changed, 1 insertion(+), 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 const { + [[nodiscard]] static auto Sinks() noexcept -> std::vector { 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 const { - auto& data = Data(); - std::lock_guard lock{data.mutex}; - return data.factories; - } - private: [[nodiscard]] static auto Data() noexcept -> ConfigData& { static ConfigData instance{}; -- cgit v1.2.3