Skip to content

Commit 0ef9386

Browse files
committed
refactor: Use member initializers in CCheckQueue
1 parent 1b313ca commit 0ef9386

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/checkqueue.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ class CCheckQueue
4444
std::vector<T> queue;
4545

4646
//! The number of workers (including the master) that are idle.
47-
int nIdle;
47+
int nIdle{0};
4848

4949
//! The total number of workers (including the master).
50-
int nTotal;
50+
int nTotal{0};
5151

5252
//! The temporary evaluation result.
53-
bool fAllOk;
53+
bool fAllOk{true};
5454

5555
/**
5656
* Number of verifications that haven't completed yet.
5757
* This includes elements that are no longer queued, but still in the
5858
* worker's own batches.
5959
*/
60-
unsigned int nTodo;
60+
unsigned int nTodo{0};
6161

6262
//! The maximum number of elements to be processed in one batch
63-
unsigned int nBatchSize;
63+
const unsigned int nBatchSize;
6464

6565
/** Internal function that does bulk of the verification work. */
6666
bool Loop(bool fMaster = false)
@@ -127,7 +127,10 @@ class CCheckQueue
127127
boost::mutex ControlMutex;
128128

129129
//! Create a new check queue
130-
explicit CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), nBatchSize(nBatchSizeIn) {}
130+
explicit CCheckQueue(unsigned int nBatchSizeIn)
131+
: nBatchSize(nBatchSizeIn)
132+
{
133+
}
131134

132135
//! Worker thread
133136
void Thread()

0 commit comments

Comments
 (0)