Skip to content

Commit

Permalink
Fixed build. Refs #13894
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 19, 2023
1 parent c3adae6 commit 72967fe
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/netedit/GNENetHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2379,10 +2379,13 @@ bool
GNENetHelper::AttributeCarriers::additionalExist(const GNEAdditional* additional) const {
// first check that additional pointer is valid
if (additional) {
// get vector with this additional element type
const auto& additionalElementTag = myAdditionals.at(additional->getTagProperty().getTag());
// find demanElement in additionalElementTag
return std::find(additionalElementTag.begin(), additionalElementTag.end(), additional) != additionalElementTag.end();
// search in additional elements
for (auto additionalPair : myAdditionals.at(additional->getTagProperty().getTag())) {
if (additionalPair.second == additional) {
return true;
}
}
return false;
} else {
throw ProcessError("Invalid additional pointer");
}
Expand Down Expand Up @@ -2437,10 +2440,13 @@ bool
GNENetHelper::AttributeCarriers::demandElementExist(GNEDemandElement* demandElement) const {
// first check that demandElement pointer is valid
if (demandElement) {
// get vector with this demand element type
const auto& demandElementTag = myDemandElements.at(demandElement->getTagProperty().getTag());
// find demanElement in demandElementTag
return std::find(demandElementTag.begin(), demandElementTag.end(), demandElement) != demandElementTag.end();
// search in demand elements
for (auto demandElementPair : myDemandElements.at(demandElement->getTagProperty().getTag())) {
if (demandElementPair.second == demandElement) {
return true;
}
}
return false;
} else {
throw ProcessError("Invalid demandElement pointer");
}
Expand Down

0 comments on commit 72967fe

Please sign in to comment.