0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-06 14:19:59 -05:00

refactor: Use member initializers in CCheckQueue

This commit is contained in:
Hennadii Stepanov 2020-08-21 09:23:42 +03:00
parent 1b313cacc9
commit 0ef938685b
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -44,23 +44,23 @@ private:
std::vector<T> queue; std::vector<T> queue;
//! The number of workers (including the master) that are idle. //! The number of workers (including the master) that are idle.
int nIdle; int nIdle{0};
//! The total number of workers (including the master). //! The total number of workers (including the master).
int nTotal; int nTotal{0};
//! The temporary evaluation result. //! The temporary evaluation result.
bool fAllOk; bool fAllOk{true};
/** /**
* Number of verifications that haven't completed yet. * Number of verifications that haven't completed yet.
* This includes elements that are no longer queued, but still in the * This includes elements that are no longer queued, but still in the
* worker's own batches. * worker's own batches.
*/ */
unsigned int nTodo; unsigned int nTodo{0};
//! The maximum number of elements to be processed in one batch //! 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. */ /** Internal function that does bulk of the verification work. */
bool Loop(bool fMaster = false) bool Loop(bool fMaster = false)
@ -127,7 +127,10 @@ public:
boost::mutex ControlMutex; boost::mutex ControlMutex;
//! Create a new check queue //! 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 //! Worker thread
void Thread() void Thread()