mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 08:46:45 +08:00
refactor: improve emplace construction for shm_data in mutex.h
This commit is contained in:
parent
025311d5f6
commit
805490605e
@ -126,9 +126,9 @@ class mutex {
|
||||
auto it = info.mutex_handles.find(name);
|
||||
if (it == info.mutex_handles.end()) {
|
||||
it = info.mutex_handles
|
||||
.emplace(
|
||||
std::piecewise_construct, std::forward_as_tuple(name),
|
||||
std::forward_as_tuple(curr_prog::shm_data::init{name}))
|
||||
.emplace(std::piecewise_construct,
|
||||
std::forward_as_tuple(name),
|
||||
std::forward_as_tuple(curr_prog::shm_data::init{name}))
|
||||
.first;
|
||||
}
|
||||
mutex_ = &it->second.mtx;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user