From 40a0f9fb967a4c7e74d3a6fd4d05744af40fac68 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 16 Jul 2017 23:42:27 +0200 Subject: [PATCH] Enable devirtualization opportunities by using the final specifier (C++11) * Declaring CCoinsViewErrorCatcher final enables devirtualization of two calls * Declaring CReserveKey final enables devirtualization of one call --- src/init.cpp | 2 +- src/wallet/wallet.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index d9b98be739d8f..b64d303bd6838 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -133,7 +133,7 @@ bool ShutdownRequested() * chainstate, while keeping user interface out of the common library, which is shared * between bitcoind, and bitcoin-qt and non-server tools. */ -class CCoinsViewErrorCatcher : public CCoinsViewBacked +class CCoinsViewErrorCatcher final : public CCoinsViewBacked { public: CCoinsViewErrorCatcher(CCoinsView* view) : CCoinsViewBacked(view) {} diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 9901f5f8c0fa5..11ea89dc6ca56 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1135,7 +1135,7 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface }; /** A key allocated from the key pool. */ -class CReserveKey : public CReserveScript +class CReserveKey final : public CReserveScript { protected: CWallet* pwallet;