From 819eb27c5d741630e88adbdd340eb684115e8570 Mon Sep 17 00:00:00 2001 From: gabime Date: Sun, 17 Mar 2024 00:30:05 +0200 Subject: [PATCH] Use find if registry is bigger than 10 in registry::get(std::string_view logger_name) --- include/spdlog/details/registry-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/details/registry-inl.h b/include/spdlog/details/registry-inl.h index 4be34c9e..695f2974 100644 --- a/include/spdlog/details/registry-inl.h +++ b/include/spdlog/details/registry-inl.h @@ -99,7 +99,7 @@ std::shared_ptr registry::get(const std::string &logger_name) { // otherwise use the standard find() SPDLOG_INLINE std::shared_ptr registry::get(std::string_view logger_name) { std::lock_guard lock(logger_map_mutex_); - if (loggers_.size() <= 20) { + if (loggers_.size() <= 10) { for (const auto &[key, val]: loggers_) { if (logger_name == key) { return val;