Skip to content

Commit

Permalink
Use find if registry is bigger than 10 in registry::get(std::string_v…
Browse files Browse the repository at this point in the history
…iew logger_name)
  • Loading branch information
gabime committed Mar 16, 2024
1 parent 4052bc0 commit 819eb27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/spdlog/details/registry-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ std::shared_ptr<logger> registry::get(const std::string &logger_name) {
// otherwise use the standard find()
SPDLOG_INLINE 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 819eb27

Please sign in to comment.