From 38371fe908e14a1362d6e5a5bfa38bc5ea92daec Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Thu, 7 Sep 2017 18:25:08 +0300 Subject: Simplify CPDF_SyntaxParser::GetNextWordInternal. Use CPDF_SyntaxParser::ToNextWord to move position on word start. Change-Id: I6b63efc9027b2a4eb4749561bf8ce2b95527d03b Reviewed-on: https://pdfium-review.googlesource.com/12830 Commit-Queue: Art Snake Reviewed-by: dsinclair --- core/fpdfapi/parser/cpdf_syntax_parser.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index c3ebbdaee9..f7c79bc950 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -125,27 +125,11 @@ void CPDF_SyntaxParser::GetNextWordInternal(bool* bIsNumber) { if (bIsNumber) *bIsNumber = true; + ToNextWord(); uint8_t ch; if (!GetNextChar(ch)) return; - while (1) { - while (PDFCharIsWhitespace(ch)) { - if (!GetNextChar(ch)) - return; - } - - if (ch != '%') - break; - - while (1) { - if (!GetNextChar(ch)) - return; - if (PDFCharIsLineEnding(ch)) - break; - } - } - if (PDFCharIsDelimiter(ch)) { if (bIsNumber) *bIsNumber = false; -- cgit v1.2.3