perf: 修改异步加载资源的方式

This commit is contained in:
MistEO
2023-05-02 15:16:07 +08:00
parent 85b964020b
commit 7dc0fd348d
5 changed files with 73 additions and 44 deletions

View File

@@ -437,10 +437,7 @@ void Assistant::msg_proc()
continue;
}
// 结构化绑定只能是引用后续的pop会使引用失效所以需要重新构造一份这里采用了move的方式
auto&& [temp_msg, temp_detail] = m_msg_queue.front();
AsstMsg msg = temp_msg;
json::value detail = std::move(temp_detail);
auto [msg, detail] = std::move(m_msg_queue.front());
m_msg_queue.pop();
lock.unlock();