From 8f67be51acc92dfc348d33e3b085018e4c07f333 Mon Sep 17 00:00:00 2001 From: Jason Marechal Date: Tue, 17 Dec 2024 10:55:28 +0100 Subject: [PATCH] Fix: pattern should only match at the start not inside the string --- src/cpp/benders/benders_core/VariablesGroup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpp/benders/benders_core/VariablesGroup.cpp b/src/cpp/benders/benders_core/VariablesGroup.cpp index e949467be..8cd97d3be 100644 --- a/src/cpp/benders/benders_core/VariablesGroup.cpp +++ b/src/cpp/benders/benders_core/VariablesGroup.cpp @@ -30,7 +30,7 @@ void VariablesGroup::Search() { auto pattern = single_input_data.Pattern().Value(); int var_index(0); for (const auto& variable : all_variables_) { - if (variable.find(pattern) != std::string::npos) { + if (variable.starts_with(pattern)) { indices_[pattern_index].push_back(var_index); } ++var_index;