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

Unified Diff: Source/wtf/text/StringBuffer.h

Issue 20002008: Don't use Vector<UChar> to build strings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix unit test Created 7 years, 5 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/platform/text/LocaleICU.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringBuffer.h
diff --git a/Source/wtf/text/StringBuffer.h b/Source/wtf/text/StringBuffer.h
index 9af42dc23666528f2faa999d81d0ea723af218f5..74ad12f6070d19bc9fd5661c568c08894702cc36 100644
--- a/Source/wtf/text/StringBuffer.h
+++ b/Source/wtf/text/StringBuffer.h
@@ -70,7 +70,7 @@ public:
}
unsigned length() const { return m_data->length(); }
- CharType* characters() { return const_cast<CharType*>(m_data->getCharacters<CharType>()); }
+ CharType* characters() { return length() ? const_cast<CharType*>(m_data->getCharacters<CharType>()) : 0; }
CharType& operator[](unsigned i) { ASSERT_WITH_SECURITY_IMPLICATION(i < length()); return characters()[i]; }
« no previous file with comments | « Source/core/platform/text/LocaleICU.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698