From 0ad587f50b27baba6d8e70707448bddc84e2bd87 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 12 Dec 2014 01:36:35 +0000 Subject: [PATCH] Remove some unnecessary temporary references --- src/fortran/fct.cpp | 7 +++---- src/kinetics/importKinetics.cpp | 10 ++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/fortran/fct.cpp b/src/fortran/fct.cpp index 306a6c583..4a3e07b55 100644 --- a/src/fortran/fct.cpp +++ b/src/fortran/fct.cpp @@ -1065,7 +1065,6 @@ extern "C" { thermo_t* t = _fth(ith); Kinetics* k = _fkin(ikin); - Kinetics& kin = *k; XML_Node* x, *r=0; if (root) { r = &root->root(); @@ -1081,9 +1080,9 @@ extern "C" { return 0; } importPhase(*x, t); - kin.addPhase(*t); - kin.init(); - installReactionArrays(*x, kin, x->id()); + k->addPhase(*t); + k->init(); + installReactionArrays(*x, *k, x->id()); t->setState_TP(300.0, OneAtm); if (r) { if (&x->root() != &r->root()) { diff --git a/src/kinetics/importKinetics.cpp b/src/kinetics/importKinetics.cpp index b9fd4f77f..133c0b5aa 100644 --- a/src/kinetics/importKinetics.cpp +++ b/src/kinetics/importKinetics.cpp @@ -684,8 +684,6 @@ bool importKinetics(const XML_Node& phase, std::vector th, return false; } - Kinetics& kin = *k; - // This phase will be the owning phase for the kinetics operator // For interfaces, it is the surface phase between two volumes. // For homogeneous kinetics, it's the current volumetric phase. @@ -734,8 +732,8 @@ bool importKinetics(const XML_Node& phase, std::vector th, // if no phase with this id has been added to //the kinetics manager yet, then add this one - if (kin.phaseIndex(phase_id) == npos) { - kin.addPhase(*th[m]); + if (k->phaseIndex(phase_id) == npos) { + k->addPhase(*th[m]); } } msg += " "+th[m]->id(); @@ -749,10 +747,10 @@ bool importKinetics(const XML_Node& phase, std::vector th, // allocates arrays, etc. Must be called after the phases have // been added to 'kin', so that the number of species in each // phase is known. - kin.init(); + k->init(); // Install the reactions. - return installReactionArrays(phase, kin, owning_phase, check_for_duplicates); + return installReactionArrays(phase, *k, owning_phase, check_for_duplicates); } bool buildSolutionFromXML(XML_Node& root, const std::string& id,