mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Another try to speed up rates.
git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@8890 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
98741bbe32
commit
e168691097
@ -1913,7 +1913,7 @@ protected:
|
||||
/* utilities.cpp ------------------------------- */
|
||||
int spinner;
|
||||
std::map<std::string, double> gfw_map;
|
||||
std::map<std::string, int> rates_map;
|
||||
std::map<const char *, int> rates_map;
|
||||
|
||||
/* new after release of Version 3 */
|
||||
std::map<std::string, std::vector < std::string> > sum_species_map;
|
||||
|
||||
5
read.cpp
5
read.cpp
@ -9135,7 +9135,10 @@ read_rates(void)
|
||||
case OPTION_DEFAULT: /* read rate name */
|
||||
ptr = line;
|
||||
copy_token(token, &ptr, &l);
|
||||
rate_ptr = rate_search(token, &n);
|
||||
{
|
||||
const char *name = string_hsave(token);
|
||||
rate_ptr = rate_search(name, &n);
|
||||
}
|
||||
if (rate_ptr == NULL)
|
||||
{
|
||||
rates =
|
||||
|
||||
@ -1649,9 +1649,8 @@ rate_search(const char *name, int *n)
|
||||
* if found, the address of the pp_assemblage element
|
||||
* if not found, NULL
|
||||
*/
|
||||
std::string str(name);
|
||||
std::map<std::string, int>::iterator it;
|
||||
it = rates_map.find(str);
|
||||
std::map<const char *, int>::iterator it;
|
||||
it = rates_map.find(name);
|
||||
if (it != rates_map.end())
|
||||
{
|
||||
*n = it->second;
|
||||
@ -1669,14 +1668,14 @@ rate_search(const char *name, int *n)
|
||||
if (strcmp_nocase(rates[i].name, name) == 0)
|
||||
{
|
||||
*n = i;
|
||||
rates_map[str] = i;
|
||||
rates_map[name] = i;
|
||||
return (&(rates[i]));
|
||||
}
|
||||
}
|
||||
/*
|
||||
* rate name not found
|
||||
*/
|
||||
rates_map[str] = *n;
|
||||
rates_map[name] = *n;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user