From 0ef938685b5c079a6f5a98daf0e3865d718d817b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 21 Aug 2020 09:23:42 +0300 Subject: [PATCH] refactor: Use member initializers in CCheckQueue --- src/checkqueue.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/checkqueue.h b/src/checkqueue.h index e3faa1dec0..3e22cd8c60 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -44,23 +44,23 @@ private: std::vector queue; //! The number of workers (including the master) that are idle. - int nIdle; + int nIdle{0}; //! The total number of workers (including the master). - int nTotal; + int nTotal{0}; //! The temporary evaluation result. - bool fAllOk; + bool fAllOk{true}; /** * Number of verifications that haven't completed yet. * This includes elements that are no longer queued, but still in the * worker's own batches. */ - unsigned int nTodo; + unsigned int nTodo{0}; //! The maximum number of elements to be processed in one batch - unsigned int nBatchSize; + const unsigned int nBatchSize; /** Internal function that does bulk of the verification work. */ bool Loop(bool fMaster = false) @@ -127,7 +127,10 @@ public: boost::mutex ControlMutex; //! Create a new check queue - explicit CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), nBatchSize(nBatchSizeIn) {} + explicit CCheckQueue(unsigned int nBatchSizeIn) + : nBatchSize(nBatchSizeIn) + { + } //! Worker thread void Thread()