2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-03 19:00:51 +00:00

Remove redundant tests in QPDFTokenizer::readToken

This commit is contained in:
m-holger 2022-08-24 19:29:39 +01:00
parent 10fda01b07
commit 7108cd7b98

View File

@ -989,15 +989,14 @@ QPDFTokenizer::readToken(
this->error_message = "unexpected EOF";
offset = input->getLastOffset();
}
if (this->state != st_token_ready) {
throw std::logic_error(
"getToken returned false after presenting EOF");
}
} else {
presentCharacter(ch);
if (this->before_token && (input->getLastOffset() == offset)) {
handleCharacter(ch);
if (this->before_token) {
++offset;
}
if (this->in_token) {
this->raw_val += ch;
}
if (max_len && (this->raw_val.length() >= max_len) &&
(this->state != st_token_ready)) {
// terminate this token now