Use find if registry is bigger than 10 in registry::get(std::string_view logger_name)
This commit is contained in:
parent
4052bc0621
commit
819eb27c5d
@ -99,7 +99,7 @@ std::shared_ptr<logger> registry::get(const std::string &logger_name) {
|
|||||||
// otherwise use the standard find()
|
// otherwise use the standard find()
|
||||||
SPDLOG_INLINE std::shared_ptr<logger> registry::get(std::string_view logger_name) {
|
SPDLOG_INLINE std::shared_ptr<logger> registry::get(std::string_view logger_name) {
|
||||||
std::lock_guard<std::mutex> lock(logger_map_mutex_);
|
std::lock_guard<std::mutex> lock(logger_map_mutex_);
|
||||||
if (loggers_.size() <= 20) {
|
if (loggers_.size() <= 10) {
|
||||||
for (const auto &[key, val]: loggers_) {
|
for (const auto &[key, val]: loggers_) {
|
||||||
if (logger_name == key) {
|
if (logger_name == key) {
|
||||||
return val;
|
return val;
|
||||||
|
Loading…
Reference in New Issue
Block a user