Skip to content

Commit

Permalink
Use std::forward<WriteHandler>(handler) instead lambda callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Nov 27, 2023
1 parent f70fc8b commit 4c8311e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions proxy/include/proxy/proxy_socket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,7 @@ namespace util {
}

// 异步发送数据.
self_->next_layer_.async_write_some(buffers,
[buffers, handler = std::move(handler)]
(auto ec, auto bytes) mutable
{
handler(ec, bytes);
});
self_->next_layer_.async_write_some(buffers, std::forward<WriteHandler>(handler));
}

private:
Expand Down

0 comments on commit 4c8311e

Please sign in to comment.