mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 18:41:35 +08:00
Fixed registry impl
This commit is contained in:
parent
8f526df1a9
commit
1bde4831a0
@ -72,6 +72,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) {
|
||||
std::lock_guard<std::mutex> lock(logger_map_mutex_);
|
||||
if (loggers_.size() <= small_map_threshold) {
|
||||
for (const auto &[key, val]: loggers_) {
|
||||
if (logger_name == key) {
|
||||
@ -90,7 +91,6 @@ namespace spdlog {
|
||||
// otherwise use the standard find()
|
||||
std::shared_ptr<logger> registry::get(std::string_view logger_name) {
|
||||
std::lock_guard<std::mutex> lock(logger_map_mutex_);
|
||||
|
||||
if (loggers_.size() <= small_map_threshold) {
|
||||
for (const auto &[key, val]: loggers_) {
|
||||
if (logger_name == key) {
|
||||
|
Loading…
Reference in New Issue
Block a user