mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations.
This commit is contained in:
@@ -155,7 +155,7 @@ static void Correct_Queue_range(std::vector<size_t> range)
|
||||
}
|
||||
// Make vChecks here to save on malloc (this test can be slow...)
|
||||
std::vector<FakeCheckCheckCompletion> vChecks;
|
||||
for (auto i : range) {
|
||||
for (const size_t i : range) {
|
||||
size_t total = i;
|
||||
FakeCheckCheckCompletion::n_calls = 0;
|
||||
CCheckQueueControl<FakeCheckCheckCompletion> control(small_queue.get());
|
||||
@@ -253,7 +253,7 @@ BOOST_AUTO_TEST_CASE(test_CheckQueue_Recovers_From_Failure)
|
||||
}
|
||||
|
||||
for (auto times = 0; times < 10; ++times) {
|
||||
for (bool end_fails : {true, false}) {
|
||||
for (const bool end_fails : {true, false}) {
|
||||
CCheckQueueControl<FailingCheck> control(fail_queue.get());
|
||||
{
|
||||
std::vector<FailingCheck> vChecks;
|
||||
|
||||
Reference in New Issue
Block a user