1
0
Эх сурвалжийг харах

Range-for loop with const reference

Prevent copy-ctor and dtor to be called.
Found by Cppcheck (constVariableReference)
Christoph Grüninger 1 жил өмнө
parent
commit
01c22dfaee

+ 1 - 1
Tests/CMakeLib/testDebuggerNamedPipe.cxx

@@ -194,7 +194,7 @@ int runTest(int argc, char* argv[])
     R"("command" *: *"disconnect".*"success" *: *true.*"type" *: *"response")"
   };
 
-  for (auto& regexString : expectedResponses) {
+  for (const auto& regexString : expectedResponses) {
     cmsys::RegularExpression regex(regexString);
     if (!regex.find(debuggerResponse)) {
       std::cout << "Expected response not found: " << regexString << std::endl;