Reduce max size for sequential map search to 10

This commit is contained in:
gabime 2024-03-17 00:31:24 +02:00
parent 4a31ed38d3
commit b95e493471

View File

@ -70,7 +70,7 @@ namespace spdlog {
// if the map is small do a sequential search, otherwise use the standard find()
std::shared_ptr<logger> registry::get(const std::string &logger_name) {
if (loggers_.size() <= 20) {
if (loggers_.size() <= 10) {
for (const auto &[key, val]: loggers_) {
if (logger_name == key) {
return val;
@ -89,7 +89,7 @@ namespace spdlog {
std::shared_ptr<logger> registry::get(std::string_view logger_name) {
std::lock_guard<std::mutex> lock(logger_map_mutex_);
if (loggers_.size() <= 20) {
if (loggers_.size() <= 10) {
for (const auto &[key, val]: loggers_) {
if (logger_name == key) {
return val;