Skip to content

Commit

Permalink
Fix: pattern should only match at the start not inside the string
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 committed Dec 17, 2024
1 parent 1de598b commit 8f67be5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cpp/benders/benders_core/VariablesGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f67be5

Please sign in to comment.