Range-for loop with const reference

Prevent copy-ctor and dtor to be called.
Found by Cppcheck (constVariableReference)
This commit is contained in:
Christoph Grüninger committed 2024-02-14 20:46:02 +01:00
1 parent 3850def5e6
commit 01c22dfaee
1 file changed
+1 -1
+1 -1
View File
@@ -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;