Skip to content

Commit

Permalink
#374: use equal_range
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed May 26, 2024
1 parent 5cc7c48 commit 9f55a7a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/sbml/validator/constraints/AssignmentCycles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,12 @@ bool
AssignmentCycles::alreadyExistsInMap(IdMap& map,
const pair<const std::string, std::string>& dependency) const
{
IdIter it;
for (it = map.begin(); it != map.end(); ++it)
auto range = map.equal_range(dependency.first);

for (auto it = range.first; it != range.second; ++it)
{
if (((*it).first == dependency.first)
&& ((*it).second == dependency.second))
return true;
if (it->second == dependency.second)
return true;
}

return false;
Expand Down

0 comments on commit 9f55a7a

Please sign in to comment.