Skip to content

Commit

Permalink
Reduce max size for sequential map search to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Mar 16, 2024
1 parent 4a31ed3 commit b95e493
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/details/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit b95e493

Please sign in to comment.