فهرست منبع

Range-for loop with const reference

Prevent copy-ctor and dtor to be called.
Found by Cppcheck (constVariableReference)
Christoph Grüninger 1 سال پیش
والد
کامیت
01c22dfaee
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Tests/CMakeLib/testDebuggerNamedPipe.cxx

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