mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-28 06:50:38 +01:00
Merge #18914: refactor: Apply override specifier consistently
d044e0ec7drefactor: Remove override for final overriders (Hennadii Stepanov)1551cea2d5refactor: Use override for non-final overriders (Hennadii Stepanov) Pull request description: Two commits are split out from #16710 to make reviewing [easier](https://github.com/bitcoin/bitcoin/pull/16710#issuecomment-625760894). From [C++ FAQ](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final): > C.128: Virtual functions should specify exactly one of virtual, override, or final > **Reason** Readability. Detection of mistakes. Writing explicit `virtual`, `override`, or `final` is self-documenting and enables the compiler to catch mismatch of types and/or names between base and derived classes. However, writing more than one of these three is both redundant and a potential source of errors. ACKs for top commit: practicalswift: ACKd044e0ec7d: consistent use of `override` prevents bugs + patch looks correct + Travis happy MarcoFalke: ACKd044e0ec7d, based on my understanding that adding `override` or `final` to a function must always be correct, unless it doesn't compile!? vasild: ACKd044e0ec7Tree-SHA512: 245fd9b99b8b5cbf8694061f892cb3435f3378c97ebed9f9401ce86d21890211f2234bcc39c9f0f79a4d2806cb31bf8ce41a0f9c2acef4f3a2ac5beca6b077cf
This commit is contained in:
@@ -127,7 +127,7 @@ public:
|
||||
::tableRPC.appendCommand(m_command.name, &m_command);
|
||||
}
|
||||
|
||||
void disconnect() override final
|
||||
void disconnect() final
|
||||
{
|
||||
if (m_wrapped_command) {
|
||||
m_wrapped_command = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user