1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03: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:
Vicențiu Ciorbaru
2023-02-07 13:57:20 +02:00
parent 8dab661416
commit 08c852026d
242 changed files with 1101 additions and 1341 deletions

View File

@@ -84,8 +84,7 @@ public:
void get_normalizer(PFS_instr_class *instr_class);
/** Destructor. */
virtual ~PFS_engine_table()
{}
virtual ~PFS_engine_table() = default;
/**
Helper, assign a value to a ulong field.
@@ -260,11 +259,9 @@ struct PFS_engine_table_share
class PFS_readonly_acl : public ACL_internal_table_access
{
public:
PFS_readonly_acl()
{}
PFS_readonly_acl() = default;
~PFS_readonly_acl()
{}
~PFS_readonly_acl() = default;
virtual ACL_internal_access_result check(ulong want_access, ulong *save_priv) const;
};
@@ -279,11 +276,9 @@ extern PFS_readonly_acl pfs_readonly_acl;
class PFS_truncatable_acl : public ACL_internal_table_access
{
public:
PFS_truncatable_acl()
{}
PFS_truncatable_acl() = default;
~PFS_truncatable_acl()
{}
~PFS_truncatable_acl() = default;
ACL_internal_access_result check(ulong want_access, ulong *save_priv) const;
};
@@ -298,11 +293,9 @@ extern PFS_truncatable_acl pfs_truncatable_acl;
class PFS_updatable_acl : public ACL_internal_table_access
{
public:
PFS_updatable_acl()
{}
PFS_updatable_acl() = default;
~PFS_updatable_acl()
{}
~PFS_updatable_acl() = default;
ACL_internal_access_result check(ulong want_access, ulong *save_priv) const;
};
@@ -317,11 +310,9 @@ extern PFS_updatable_acl pfs_updatable_acl;
class PFS_editable_acl : public ACL_internal_table_access
{
public:
PFS_editable_acl()
{}
PFS_editable_acl() = default;
~PFS_editable_acl()
{}
~PFS_editable_acl() = default;
ACL_internal_access_result check(ulong want_access, ulong *save_priv) const;
};
@@ -335,11 +326,9 @@ extern PFS_editable_acl pfs_editable_acl;
class PFS_unknown_acl : public ACL_internal_table_access
{
public:
PFS_unknown_acl()
{}
PFS_unknown_acl() = default;
~PFS_unknown_acl()
{}
~PFS_unknown_acl() = default;
ACL_internal_access_result check(ulong want_access, ulong *save_priv) const;
};