1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:57:44 +00:00

Userland: Migrate to argument-less deferred_invoke

Only one place used this argument and it was to hold on to a strong ref
for the object. Since we already do that now, there's no need to keep
this argument around since this can be easily captured.

This commit contains no changes.
This commit is contained in:
sin-ack 2021-08-30 18:12:48 +00:00 committed by Ali Mohammad Pur
parent e9121f8b1f
commit 8ea22121ac
32 changed files with 72 additions and 75 deletions

View file

@ -38,7 +38,7 @@ DatabaseConnection::DatabaseConnection(String database_name, int client_id)
dbgln_if(SQLSERVER_DEBUG, "DatabaseConnection {} initiating connection with database '{}'", connection_id(), m_database_name);
s_connections.set(m_connection_id, *this);
deferred_invoke([&](Object&) {
deferred_invoke([&] {
m_database = SQL::Database::construct(String::formatted("/home/anon/sql/{}.db", m_database_name));
m_accept_statements = true;
auto client_connection = ClientConnection::client_connection_for(m_client_id);
@ -53,7 +53,7 @@ void DatabaseConnection::disconnect()
{
dbgln_if(SQLSERVER_DEBUG, "DatabaseConnection::disconnect(connection_id {}, database '{}'", connection_id(), m_database_name);
m_accept_statements = false;
deferred_invoke([&](Object&) {
deferred_invoke([&] {
m_database = nullptr;
s_connections.remove(m_connection_id);
auto client_connection = ClientConnection::client_connection_for(client_id());

View file

@ -60,7 +60,7 @@ void SQLStatement::execute()
return;
}
deferred_invoke([&](Object&) {
deferred_invoke([&] {
auto maybe_error = parse();
if (maybe_error.has_value()) {
report_error(maybe_error.value());
@ -107,7 +107,7 @@ void SQLStatement::next()
if (m_index < m_result->results().size()) {
auto& tuple = m_result->results()[m_index++];
client_connection->async_next_result(statement_id(), tuple.to_string_vector());
deferred_invoke([&](Object&) {
deferred_invoke([&] {
next();
});
} else {

View file

@ -36,10 +36,7 @@ Client::Client(NonnullRefPtr<Core::TCPSocket> socket, Core::Object* parent)
void Client::die()
{
deferred_invoke([this](auto& object) {
NonnullRefPtr protector { object };
remove_from_parent();
});
deferred_invoke([this] { remove_from_parent(); });
}
void Client::start()

View file

@ -126,7 +126,7 @@ void ClientConnection::did_error(i32 connection_id, i32 message)
void ClientConnection::did_close(i32 connection_id, u16 code, String reason, bool was_clean)
{
async_closed(connection_id, code, reason, was_clean);
deferred_invoke([this, connection_id](auto&) {
deferred_invoke([this, connection_id] {
m_connections.remove(connection_id);
});
}

View file

@ -79,7 +79,7 @@ ClientConnection::~ClientConnection()
void ClientConnection::die()
{
deferred_invoke([this](auto&) {
deferred_invoke([this] {
s_connections->remove(client_id());
});
}

View file

@ -28,7 +28,7 @@ WMClientConnection::~WMClientConnection()
void WMClientConnection::die()
{
deferred_invoke([this](auto&) {
deferred_invoke([this] {
s_connections.remove(client_id());
});
}

View file

@ -764,7 +764,7 @@ void Window::request_update(const Gfx::IntRect& rect, bool ignore_occlusion)
if (rect.is_empty())
return;
if (m_pending_paint_rects.is_empty()) {
deferred_invoke([this, ignore_occlusion](auto&) {
deferred_invoke([this, ignore_occlusion] {
client()->post_paint_message(*this, ignore_occlusion);
});
}