Skip to content

Commit

Permalink
Fix wrong iterator usage. Fix potential crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Sh committed Dec 25, 2024
1 parent 1ee94db commit f038ff4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion algorithm/MaxFlowPushRelableImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ template<class WeightTypeInterface, typename WeightType> void MaxFlowPushRelabel

_flowValue.erase(last, _flowValue.end());

for(auto element = _flowValue.begin(); element != last; element++)
for(auto element = _flowValue.begin(); element != _flowValue.end(); element++)
{
element->value = 0;
for (auto comapare = flowValueCopy.begin(); comapare != flowValueCopy.end(); comapare++)
Expand Down
4 changes: 4 additions & 0 deletions common/ConsoleParams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ void ConsoleParams::ParseCommandLine (const std::vector<String>& params, Paramet
{
commands[GetRealParamName(*param)] = *(param + 1);
}
else
{
break;
}
}
}
}
Expand Down

0 comments on commit f038ff4

Please sign in to comment.