Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations.

This commit is contained in:
practicalswift
2018-06-18 07:58:28 +02:00
parent f180e81d57
commit f34c8c466a
36 changed files with 77 additions and 77 deletions

View File

@@ -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;