use ref callback

This commit is contained in:
cqm 2024-10-31 21:39:28 +08:00
parent e69c0e648c
commit eb8e39d897

View File

@ -346,7 +346,7 @@ public:
return it->second; return it->second;
} }
void for_each(std::function<void(const std::string&, const Pointer&)> cb) { void for_each(const std::function<void(const std::string&, const Pointer&)>& cb) {
std::lock_guard<std::recursive_mutex> lck(_mtx); std::lock_guard<std::recursive_mutex> lck(_mtx);
auto it = _map.begin(); auto it = _map.begin();
while (it != _map.end()) { while (it != _map.end()) {