Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1013)

Unified Diff: Source/platform/text/SegmentedString.h

Issue 1308573006: [reland] SegmentedString::push() should always push a char in front (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test / accept yosin@ suggestion Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/parser/HTMLEntityParserTest.cpp ('k') | Source/platform/text/SegmentedStringTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/text/SegmentedString.h
diff --git a/Source/platform/text/SegmentedString.h b/Source/platform/text/SegmentedString.h
index fe4e288b98f24248a490227f3b39c18f25bbf505..c08742a569b058c081d66e6366fbe5813c0d9c31 100644
--- a/Source/platform/text/SegmentedString.h
+++ b/Source/platform/text/SegmentedString.h
@@ -190,13 +190,15 @@ public:
void push(UChar c)
{
+ ASSERT(c);
+
if (!m_pushedChar1) {
- m_pushedChar1 = c;
- m_currentChar = m_pushedChar1 ? m_pushedChar1 : m_currentString.getCurrentChar();
+ m_currentChar = m_pushedChar1 = c;
updateSlowCaseFunctionPointers();
} else {
ASSERT(!m_pushedChar2);
- m_pushedChar2 = c;
+ m_pushedChar2 = m_pushedChar1;
+ m_currentChar = m_pushedChar1 = c;
}
}
« no previous file with comments | « Source/core/html/parser/HTMLEntityParserTest.cpp ('k') | Source/platform/text/SegmentedStringTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698