@@ -717,7 +717,7 @@ CFunction * CReaction::createFunctionFromExpression(const std::string & infix)
717717 continue ;
718718
719719 // Check whether we have compartment with that name
720- for (const CCompartment * pCompartment : mChemEq .getCompartments ())
720+ for (const CCompartment * pCompartment : mChemEq .getCompartments ())
721721 if (pCompartment->getObjectName () == " Name" )
722722 {
723723 it->setUsage (CFunctionParameter::Role::VOLUME);
@@ -1712,7 +1712,7 @@ CEvaluationNodeVariable* CReaction::object2variable(const CEvaluationNodeObject*
17121712const CModel * CReaction::getFirstCModelOrDefault (std::map< const CDataObject *, SBase * > & copasi2sbmlmap)
17131713{
17141714
1715- for (auto & pair : copasi2sbmlmap)
1715+ for (auto & pair : copasi2sbmlmap)
17161716 {
17171717 const CModel * pModel = dynamic_cast <const CModel*>(pair.first ->getObjectAncestor (" Model" ));
17181718
@@ -1866,16 +1866,15 @@ CFunction * CReaction::setFunctionFromExpressionTree(const CExpression & express
18661866 {
18671867 if (SBMLImporter::areEqualFunctions (pExistingFunction, pTmpFunction))
18681868 {
1869-
1870- setFunction (pExistingFunction);
1871-
18721869 // The functions and their signature are equal however the role of the variables
18731870 // might not be defined for the existing function if this is the first time it is used
1874- mpFunction ->setReversible (pTmpFunction->isReversible ());
1875- mpFunction ->getVariables () = pTmpFunction->getVariables ();
1871+ pExistingFunction ->setReversible (pTmpFunction->isReversible ());
1872+ pExistingFunction ->getVariables () = pTmpFunction->getVariables ();
18761873
18771874 pdelete (pTmpFunction);
18781875
1876+ setFunction (pExistingFunction);
1877+
18791878 // we still need to do the mapping, otherwise global parameters might not be mapped
18801879 it = replacementMap.begin ();
18811880
0 commit comments