Use seekg, in place of multiple ungets.

This commit is contained in:
John Wiegley 2009-02-07 04:27:14 -04:00
parent 682544ef17
commit 19694cf2a2

View file

@ -406,13 +406,7 @@ void expr_t::token_t::next(std::istream& in, const uint_least8_t pflags)
void expr_t::token_t::rewind(std::istream& in)
{
#if 0
in.seekg(- length, std::ios::cur);
#else
for (unsigned int i = 0; i < length; i++)
in.unget();
#endif
if (in.fail())
throw_(parse_error, "Failed to rewind input stream");
}