mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2026-02-07 18:26:41 +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);
|
auto it = info.mutex_handles.find(name);
|
||||||
if (it == info.mutex_handles.end()) {
|
if (it == info.mutex_handles.end()) {
|
||||||
it = info.mutex_handles
|
it = info.mutex_handles
|
||||||
.emplace(
|
.emplace(std::piecewise_construct,
|
||||||
std::piecewise_construct, std::forward_as_tuple(name),
|
std::forward_as_tuple(name),
|
||||||
std::forward_as_tuple(curr_prog::shm_data::init{name}))
|
std::forward_as_tuple(curr_prog::shm_data::init{name}))
|
||||||
.first;
|
.first;
|
||||||
}
|
}
|
||||||
mutex_ = &it->second.mtx;
|
mutex_ = &it->second.mtx;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user