Skip to content

Commit b95e493

Browse files
committed
Reduce max size for sequential map search to 10
1 parent 4a31ed3 commit b95e493

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/details/registry.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace spdlog {
7070

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

92-
if (loggers_.size() <= 20) {
92+
if (loggers_.size() <= 10) {
9393
for (const auto &[key, val]: loggers_) {
9494
if (logger_name == key) {
9595
return val;

0 commit comments

Comments
 (0)