mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
Default_pe is now const char *, saves some string_hsave in clear in prep.
Test cases are OK. git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@7722 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
d7321bd3e9
commit
f127add44a
@ -31,8 +31,8 @@ class cxxISolution: public PHRQ_base
|
||||
else
|
||||
this->units.clear();
|
||||
}
|
||||
std::string Get_default_pe() const {return default_pe;}
|
||||
void Set_default_pe(std::string pe) {default_pe = pe;}
|
||||
const char * Get_default_pe() const {return default_pe;}
|
||||
void Set_default_pe(const char * pe) {default_pe = pe;}
|
||||
std::map < std::string, cxxISolutionComp > &Get_comps(void) {return this->comps;}
|
||||
const std::map < std::string, cxxISolutionComp > &Get_comps(void)const {return this->comps;}
|
||||
void Set_comps(std::map < std::string, cxxISolutionComp > &c) {this->comps = c;}
|
||||
@ -46,7 +46,7 @@ class cxxISolution: public PHRQ_base
|
||||
std::string units;
|
||||
std::map < std::string, cxxISolutionComp > comps;
|
||||
std::map <std::string, cxxChemRxn > pe_reactions;
|
||||
std::string default_pe;
|
||||
const char * default_pe;
|
||||
};
|
||||
|
||||
#endif // !defined(ISOLUTION_H_INCLUDED)
|
||||
|
||||
7
prep.cpp
7
prep.cpp
@ -1804,17 +1804,20 @@ clear(void)
|
||||
/*
|
||||
* Clear master species solution-dependent data
|
||||
*/
|
||||
const char * pe_str = string_hsave("pe");
|
||||
for (i = 0; i < count_master; i++)
|
||||
{
|
||||
master[i]->in = FALSE;
|
||||
master[i]->unknown = NULL;
|
||||
if (solution_ptr->Get_initial_data())
|
||||
{
|
||||
master[i]->pe_rxn = string_hsave(solution_ptr->Get_initial_data()->Get_default_pe().c_str());
|
||||
//master[i]->pe_rxn = string_hsave(solution_ptr->Get_initial_data()->Get_default_pe().c_str());
|
||||
master[i]->pe_rxn = solution_ptr->Get_initial_data()->Get_default_pe();
|
||||
}
|
||||
else
|
||||
{
|
||||
master[i]->pe_rxn = string_hsave("pe");
|
||||
//master[i]->pe_rxn = string_hsave("pe");
|
||||
master[i]->pe_rxn = pe_str;
|
||||
}
|
||||
/*
|
||||
* copy primary reaction to secondary reaction
|
||||
|
||||
4
read.cpp
4
read.cpp
@ -5172,7 +5172,9 @@ read_solution(void)
|
||||
break;
|
||||
if (parser.parse_couple(token) == CParser::PARSER_OK)
|
||||
{
|
||||
isoln_ptr->Set_default_pe(token);
|
||||
const char * str = string_hsave(token.c_str());
|
||||
//isoln_ptr->Set_default_pe(token);
|
||||
isoln_ptr->Set_default_pe(str);
|
||||
cxxChemRxn temp_chem_reaction;
|
||||
isoln_ptr->Get_pe_reactions()[token] = temp_chem_reaction;
|
||||
}
|
||||
|
||||
@ -688,7 +688,8 @@ spread_row_to_solution(struct spread_row *heading, struct spread_row *units,
|
||||
break;
|
||||
if (parser.parse_couple(token) == OK)
|
||||
{
|
||||
initial_data_ptr->Set_default_pe(token);
|
||||
const char * pe_str = string_hsave(token.c_str());
|
||||
initial_data_ptr->Set_default_pe(pe_str);
|
||||
cxxChemRxn temp_chem_reaction;
|
||||
initial_data_ptr->Get_pe_reactions()[token] = temp_chem_reaction;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user