Lexer: Removed one indirect lookup from ::dequote

This commit is contained in:
Paul Beckingham 2015-10-11 09:05:12 -04:00
parent cfebb21260
commit e8f4d6904b

View file

@ -313,13 +313,15 @@ bool Lexer::isPunctuation (int c)
}
////////////////////////////////////////////////////////////////////////////////
// Assumes that quotes is a string containing a non-trivial set of quote
// characters.
void Lexer::dequote (std::string& input, const std::string& quotes)
{
int quote = input[0];
if (quotes.find (quote) != std::string::npos)
{
size_t len = input.length ();
if (input[0] == input[len - 1])
if (quote == input[len - 1])
input = input.substr (1, len - 2);
}
}