mirror of
https://github.com/Icinga/icinga2.git
synced 2026-04-24 15:48:51 -04:00
SpawnCoroutine: move callback into wrapper lambda
f isn't used otherwise in the function, so if possible, it can just be moved into the lambda, avoiding a copy. Co-authored-by: Alexander Aleksandrovič Klimov <alexander.klimov@icinga.com>
This commit is contained in:
parent
d1d399f8b3
commit
d3fae440d4
1 changed files with 1 additions and 1 deletions
|
|
@ -105,7 +105,7 @@ public:
|
|||
|
||||
template <typename Handler, typename Function>
|
||||
static void SpawnCoroutine(Handler& h, Function f) {
|
||||
auto wrapper = [f](boost::asio::yield_context yc) {
|
||||
auto wrapper = [f = std::move(f)](boost::asio::yield_context yc) {
|
||||
try {
|
||||
f(yc);
|
||||
} catch (const std::exception& ex) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue