mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 14:48:46 +02:00
Merge bitcoin/bitcoin#30406: refactor: modernize-use-equals-default
3333bae9b2tidy: modernize-use-equals-default (MarcoFalke) Pull request description: Prior to C++20, `modernize-use-equals-default` could have been problematic because it could turn a non-aggregate into an aggregate. The risk would be that aggregate initialization would be enabled where the author did not intend to enable it. With C++20, aggregate for those is forbidden either way. (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1008r1.pdf) So enabled it for code clarity, consistency, and possibly unlocking compiler optimizations. See https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html ACKs for top commit: stickies-v: ACK3333bae9b2Tree-SHA512: ab42ff01be7ca7e7d8b4c6a485e68426f59627d83dd827cf292304829562348dc17a52ee009f5f6f3c1c2081d7166ffac4baef23197ebeba8de7767c6ddfe255
This commit is contained in:
@@ -255,7 +255,7 @@ struct OutputGroup
|
||||
/** Total weight of the UTXOs in this group. */
|
||||
int m_weight{0};
|
||||
|
||||
OutputGroup() {}
|
||||
OutputGroup() = default;
|
||||
OutputGroup(const CoinSelectionParams& params) :
|
||||
m_long_term_feerate(params.m_long_term_feerate),
|
||||
m_subtract_fee_outputs(params.m_subtract_fee_outputs)
|
||||
|
||||
@@ -30,8 +30,8 @@ bool operator<(Span<const std::byte> a, BytePrefix b);
|
||||
class DatabaseCursor
|
||||
{
|
||||
public:
|
||||
explicit DatabaseCursor() {}
|
||||
virtual ~DatabaseCursor() {}
|
||||
explicit DatabaseCursor() = default;
|
||||
virtual ~DatabaseCursor() = default;
|
||||
|
||||
DatabaseCursor(const DatabaseCursor&) = delete;
|
||||
DatabaseCursor& operator=(const DatabaseCursor&) = delete;
|
||||
@@ -56,8 +56,8 @@ private:
|
||||
virtual bool HasKey(DataStream&& key) = 0;
|
||||
|
||||
public:
|
||||
explicit DatabaseBatch() {}
|
||||
virtual ~DatabaseBatch() {}
|
||||
explicit DatabaseBatch() = default;
|
||||
virtual ~DatabaseBatch() = default;
|
||||
|
||||
DatabaseBatch(const DatabaseBatch&) = delete;
|
||||
DatabaseBatch& operator=(const DatabaseBatch&) = delete;
|
||||
@@ -131,7 +131,7 @@ class WalletDatabase
|
||||
public:
|
||||
/** Create dummy DB handle */
|
||||
WalletDatabase() : nUpdateCounter(0) {}
|
||||
virtual ~WalletDatabase() {};
|
||||
virtual ~WalletDatabase() = default;
|
||||
|
||||
/** Open the database if it is not already opened. */
|
||||
virtual void Open() = 0;
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
{
|
||||
if (open) Open();
|
||||
}
|
||||
~BerkeleyRODatabase(){};
|
||||
~BerkeleyRODatabase() = default;
|
||||
|
||||
BerkeleyROData m_records;
|
||||
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
|
||||
public:
|
||||
explicit BerkeleyROCursor(const BerkeleyRODatabase& database, Span<const std::byte> prefix = {});
|
||||
~BerkeleyROCursor() {}
|
||||
~BerkeleyROCursor() = default;
|
||||
|
||||
Status Next(DataStream& key, DataStream& value) override;
|
||||
};
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
|
||||
public:
|
||||
explicit BerkeleyROBatch(const BerkeleyRODatabase& database) : m_database(database) {}
|
||||
~BerkeleyROBatch() {}
|
||||
~BerkeleyROBatch() = default;
|
||||
|
||||
BerkeleyROBatch(const BerkeleyROBatch&) = delete;
|
||||
BerkeleyROBatch& operator=(const BerkeleyROBatch&) = delete;
|
||||
|
||||
@@ -178,7 +178,7 @@ protected:
|
||||
|
||||
public:
|
||||
explicit ScriptPubKeyMan(WalletStorage& storage) : m_storage(storage) {}
|
||||
virtual ~ScriptPubKeyMan() {};
|
||||
virtual ~ScriptPubKeyMan() = default;
|
||||
virtual util::Result<CTxDestination> GetNewDestination(const OutputType type) { return util::Error{Untranslated("Not supported")}; }
|
||||
virtual isminetype IsMine(const CScript& script) const { return ISMINE_NO; }
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
std::vector<std::byte> m_prefix_range_start;
|
||||
std::vector<std::byte> m_prefix_range_end;
|
||||
|
||||
explicit SQLiteCursor() {}
|
||||
explicit SQLiteCursor() = default;
|
||||
explicit SQLiteCursor(std::vector<std::byte> start_range, std::vector<std::byte> end_range)
|
||||
: m_prefix_range_start(std::move(start_range)),
|
||||
m_prefix_range_end(std::move(end_range))
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
class SQliteExecHandler
|
||||
{
|
||||
public:
|
||||
virtual ~SQliteExecHandler() {}
|
||||
virtual ~SQliteExecHandler() = default;
|
||||
virtual int Exec(SQLiteDatabase& database, const std::string& statement);
|
||||
};
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
explicit MockableCursor(const MockableData& records, bool pass) : m_cursor(records.begin()), m_cursor_end(records.end()), m_pass(pass) {}
|
||||
MockableCursor(const MockableData& records, bool pass, Span<const std::byte> prefix);
|
||||
~MockableCursor() {}
|
||||
~MockableCursor() = default;
|
||||
|
||||
Status Next(DataStream& key, DataStream& value) override;
|
||||
};
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
|
||||
public:
|
||||
explicit MockableBatch(MockableData& records, bool pass) : m_records(records), m_pass(pass) {}
|
||||
~MockableBatch() {}
|
||||
~MockableBatch() = default;
|
||||
|
||||
void Flush() override {}
|
||||
void Close() override {}
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
bool m_pass{true};
|
||||
|
||||
MockableDatabase(MockableData records = {}) : WalletDatabase(), m_records(records) {}
|
||||
~MockableDatabase() {};
|
||||
~MockableDatabase() = default;
|
||||
|
||||
void Open() override {}
|
||||
void AddRef() override {}
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
SER_READ(obj, obj.DeserializeDescriptor(descriptor_str));
|
||||
}
|
||||
|
||||
WalletDescriptor() {}
|
||||
WalletDescriptor() = default;
|
||||
WalletDescriptor(std::shared_ptr<Descriptor> descriptor, uint64_t creation_time, int32_t range_start, int32_t range_end, int32_t next_index) : descriptor(descriptor), id(DescriptorID(*descriptor)), creation_time(creation_time), range_start(range_start), range_end(range_end), next_index(next_index) { }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user