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

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: Adding CORE_EXPORT per tasak@ 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
Index: Source/platform/text/SegmentedString.h
diff --git a/Source/platform/text/SegmentedString.h b/Source/platform/text/SegmentedString.h
index 88ffb605caae433f8f3e524b58b758c778e92196..7daa101f2a3f980cd9daee06b778a56e77549102 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;
}
}

Powered by Google App Engine
This is Rietveld 408576698