mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 08:25:43 +08:00
Reduce max size for sequential map search to 10
This commit is contained in:
parent
4a31ed38d3
commit
b95e493471
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user