Skip to content

Commit

Permalink
Refactor: Use const ref db connection param instead of ptr
Browse files Browse the repository at this point in the history
In enable_check_trigger()
  • Loading branch information
joto committed Jan 27, 2024
1 parent 0d67c40 commit 0a9e7de
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/flex-table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ void table_connection_t::connect(std::string const &conninfo)
m_db_connection->exec("SET synchronous_commit = off");
}

static void
enable_check_trigger(pg_conn_t *db_connection, flex_table_t const &table)
static void enable_check_trigger(pg_conn_t const &db_connection,
flex_table_t const &table)
{
std::string checks;

Expand All @@ -269,7 +269,7 @@ enable_check_trigger(pg_conn_t *db_connection, flex_table_t const &table)
// remove last " AND "
checks.resize(checks.size() - 5);

create_geom_check_trigger(*db_connection, table.schema(), table.name(),
create_geom_check_trigger(db_connection, table.schema(), table.name(),
checks);
}

Expand All @@ -291,7 +291,7 @@ void table_connection_t::start(bool append)
: flex_table_t::table_type::permanent,
table().full_name()));

enable_check_trigger(m_db_connection.get(), table());
enable_check_trigger(*m_db_connection, table());
}

prepare();
Expand Down Expand Up @@ -357,7 +357,7 @@ void table_connection_t::stop(bool updateable, bool append)
m_id_index_created = false;

if (updateable) {
enable_check_trigger(m_db_connection.get(), table());
enable_check_trigger(*m_db_connection, table());
}
}

Expand Down

0 comments on commit 0a9e7de

Please sign in to comment.