mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
Apply clang-tidy to remove empty constructors / destructors
This patch is the result of running run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' . Code style changes have been done on top. The result of this change leads to the following improvements: 1. Binary size reduction. * For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by ~400kb. * A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb. 2. Compiler can better understand the intent of the code, thus it leads to more optimization possibilities. Additionally it enabled detecting unused variables that had an empty default constructor but not marked so explicitly. Particular change required following this patch in sql/opt_range.cc result_keys, an unused template class Bitmap now correctly issues unused variable warnings. Setting Bitmap template class constructor to default allows the compiler to identify that there are no side-effects when instantiating the class. Previously the compiler could not issue the warning as it assumed Bitmap class (being a template) would not be performing a NO-OP for its default constructor. This prevented the "unused variable warning".
This commit is contained in:
parent
8dab661416
commit
08c852026d
242 changed files with 1101 additions and 1341 deletions
|
|
@ -118,9 +118,7 @@ federatedx_io_null::federatedx_io_null(FEDERATEDX_SERVER *aserver)
|
|||
}
|
||||
|
||||
|
||||
federatedx_io_null::~federatedx_io_null()
|
||||
{
|
||||
}
|
||||
federatedx_io_null::~federatedx_io_null() = default;
|
||||
|
||||
|
||||
void federatedx_io_null::reset()
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ ha_federatedx_derived_handler::ha_federatedx_derived_handler(THD *thd,
|
|||
derived= dt;
|
||||
}
|
||||
|
||||
ha_federatedx_derived_handler::~ha_federatedx_derived_handler() {}
|
||||
ha_federatedx_derived_handler::~ha_federatedx_derived_handler() = default;
|
||||
|
||||
int ha_federatedx_derived_handler::init_scan()
|
||||
{
|
||||
|
|
@ -281,7 +281,7 @@ ha_federatedx_select_handler::ha_federatedx_select_handler(THD *thd,
|
|||
select= sel;
|
||||
}
|
||||
|
||||
ha_federatedx_select_handler::~ha_federatedx_select_handler() {}
|
||||
ha_federatedx_select_handler::~ha_federatedx_select_handler() = default;
|
||||
|
||||
int ha_federatedx_select_handler::init_scan()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1809,7 +1809,7 @@ int ha_federatedx::open(const char *name, int mode, uint test_if_locked)
|
|||
class Net_error_handler : public Internal_error_handler
|
||||
{
|
||||
public:
|
||||
Net_error_handler() {}
|
||||
Net_error_handler() = default;
|
||||
|
||||
public:
|
||||
bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate,
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ private:
|
|||
int real_connect(FEDERATEDX_SHARE *my_share, uint create_flag);
|
||||
public:
|
||||
ha_federatedx(handlerton *hton, TABLE_SHARE *table_arg);
|
||||
~ha_federatedx() {}
|
||||
~ha_federatedx() = default;
|
||||
/*
|
||||
The name of the index type that will be used for display
|
||||
don't implement this method unless you really have indexes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue