From 9f374b0a3c8283eb457ce29ade9c0f19643cd1f4 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 19 Sep 2017 11:18:28 -0400 Subject: Cleanup FindNextBreakPos variables The ePreType flag is only used if bFirst is true. After the first iteration of the loop bFirst is always false. This CL removes the updating of ePreType as it will never be used. Also bFirst is only set false at the end of the loop and the do {} while is changed into a while {} Change-Id: Iaced1b38bddcc6f5483ae20993ac69c93b2e3f97 Reviewed-on: https://pdfium-review.googlesource.com/14292 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- xfa/fde/cfde_texteditengine.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'xfa') diff --git a/xfa/fde/cfde_texteditengine.cpp b/xfa/fde/cfde_texteditengine.cpp index a28aeb5f6c..233d958094 100644 --- a/xfa/fde/cfde_texteditengine.cpp +++ b/xfa/fde/cfde_texteditengine.cpp @@ -1039,7 +1039,7 @@ void CFDE_TextEditEngine::Iterator::FindNextBreakPos(bool bPrev) { WordBreakProperty eCurType = GetWordBreakProperty(GetChar()); bool bFirst = true; - do { + while (!IsEOF(bPrev)) { Next(bPrev); WordBreakProperty eNextType = GetWordBreakProperty(GetChar()); @@ -1059,7 +1059,6 @@ void CFDE_TextEditEngine::Iterator::FindNextBreakPos(bool bPrev) { Next(bPrev); wBreak = false; } - bFirst = false; } if (wBreak) { int32_t nFlags = GetBreakFlagsFor(eNextType, eCurType); @@ -1077,8 +1076,7 @@ void CFDE_TextEditEngine::Iterator::FindNextBreakPos(bool bPrev) { } } } - ePreType = eCurType; eCurType = eNextType; bFirst = false; - } while (!IsEOF(bPrev)); + } } -- cgit v1.2.3