Simplified get_total_element a bit

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@2378 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2007-11-08 00:08:45 +00:00
parent f4777a194b
commit 5764f894ad

View File

@ -853,27 +853,18 @@ double cxxSolution::get_total_element(char *string)const
double d = 0.0;
for (it = this->totals.begin(); it != this->totals.end(); ++it)
{
#ifdef SKIP
char token[MAX_LENGTH], token1[MAX_LENGTH];
int n;
char *ptr;
strcpy(token, it->first);
replace("(", " ", token);
ptr = token;
copy_token(token1, &ptr, &n);
if (strcmp(token1, string) == 0) {
d += it->second;
}
#endif
char token[MAX_LENGTH], token1[MAX_LENGTH];
int n;
char *ptr;
strcpy(token, it->first);
replace("(", "\0", token);
if (strcmp(token, string) == 0) {
d += it->second;
char token[MAX_LENGTH];
if (it->first[0] == string[0])
{
strcpy(token, it->first);
replace("(", "\0", token);
if (strcmp(token, string) == 0)
{
d += it->second;
}
}
#ifdef SKIP
// C++ way to do it
std::string ename(string);
std::string current_ename(it->first);
std::basic_string <char>::size_type indexCh;