From 9f55a7aabe9296bc40ea658a0bddc5b4e602f259 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Sun, 26 May 2024 12:19:37 +0000 Subject: [PATCH] #374: use equal_range --- src/sbml/validator/constraints/AssignmentCycles.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/sbml/validator/constraints/AssignmentCycles.cpp b/src/sbml/validator/constraints/AssignmentCycles.cpp index 7e6a52b8b..f6a1be154 100644 --- a/src/sbml/validator/constraints/AssignmentCycles.cpp +++ b/src/sbml/validator/constraints/AssignmentCycles.cpp @@ -274,13 +274,12 @@ bool AssignmentCycles::alreadyExistsInMap(IdMap& map, const pair& 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;