Commit e326e783 authored by kouhei@chromium.org's avatar kouhei@chromium.org

SegmentedString: Use decrementAndCheckLength where possible

This CL removes duplicated decrementAndCheckLength() logic in SegmentedString.

BUG=None
TESTS=Refactoring only. No change in behaviour

Review URL: https://codereview.chromium.org/1320813002

git-svn-id: svn://svn.chromium.org/blink/trunk@201286 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5210c483
......@@ -219,12 +219,7 @@ public:
if (m_fastPathFlags & Use8BitAdvance) {
ASSERT(!m_pushedChar1);
m_currentChar = m_currentString.incrementAndGetCurrentChar8();
m_currentString.decrementLength();
if (!m_currentString.haveOneCharacterLeft())
return;
updateSlowCaseFunctionPointers();
decrementAndCheckLength();
return;
}
......@@ -238,17 +233,13 @@ public:
bool haveNewLine = (m_currentChar == '\n') & !!(m_fastPathFlags & Use8BitAdvanceAndUpdateLineNumbers);
m_currentChar = m_currentString.incrementAndGetCurrentChar8();
m_currentString.decrementLength();
bool haveOneCharacterLeft = m_currentString.haveOneCharacterLeft();
decrementAndCheckLength();
if (haveNewLine) {
++m_currentLine;
m_numberOfCharactersConsumedPriorToCurrentLine = m_numberOfCharactersConsumedPriorToCurrentString + m_currentString.numberOfCharactersConsumed();
}
if (haveOneCharacterLeft)
updateSlowCaseFunctionPointers();
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment