Commit 9cff8768 by Maarten L. Hekkelman

Merge branch 'potential-performance-gain' into trunk

parents cc671b80 728abe6d
......@@ -257,7 +257,7 @@ class sac_parser
CIFToken m_lookahead;
std::string m_token_value;
CIFValue mTokenType;
std::stack<int> m_buffer;
std::string m_buffer; // retract buffer, used to be a stack<char>
};
// --------------------------------------------------------------------
......
......@@ -68,8 +68,8 @@ int sac_parser::get_next_char()
result = m_source.get();
else
{
result = m_buffer.top();
m_buffer.pop();
result = m_buffer.back();
m_buffer.pop_back();
}
// very simple CR/LF translation into LF
......@@ -77,11 +77,11 @@ int sac_parser::get_next_char()
{
int lookahead = m_source.get();
if (lookahead != '\n')
m_buffer.push(lookahead);
m_buffer.push_back(lookahead);
result = '\n';
}
m_token_value += static_cast<char>(result);
m_token_value.push_back(static_cast<char>(result));
if (result == '\n')
++m_line_nr;
......@@ -106,7 +106,7 @@ void sac_parser::retract()
if (ch == '\n')
--m_line_nr;
m_buffer.push(ch);
m_buffer.push_back(ch);
m_token_value.pop_back();
}
......
......@@ -1427,10 +1427,9 @@ bool Remark3Parser::parse(const std::string &expMethod, PDBRecord *r, cif::datab
sort(scores.begin(), scores.end());
bool guessProgram = scores.empty() or scores.front().score < 0.9f;
;
if (guessProgram)
{
if (cif::VERBOSE >= 0)
if (cif::VERBOSE > 0)
std::cerr << "Unknown or untrusted program in REMARK 3, trying all parsers to see if there is a match" << std::endl;
tryParser(new BUSTER_TNT_Remark3Parser("BUSTER-TNT", expMethod, r, db));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment