diff options
Diffstat (limited to 'WebCore/platform/text/StringBuilder.cpp')
-rw-r--r-- | WebCore/platform/text/StringBuilder.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/WebCore/platform/text/StringBuilder.cpp b/WebCore/platform/text/StringBuilder.cpp index 0e9555c..c21e366 100644 --- a/WebCore/platform/text/StringBuilder.cpp +++ b/WebCore/platform/text/StringBuilder.cpp @@ -79,9 +79,10 @@ String StringBuilder::toString() const if (count == 1) return m_strings[0]; - StringBuffer buffer(m_totalLength); + UChar* buffer; + String result = String::createUninitialized(m_totalLength, buffer); - UChar* p = buffer.characters(); + UChar* p = buffer; for (unsigned i = 0; i < count; ++i) { StringImpl* string = m_strings[i].impl(); unsigned length = string->length(); @@ -89,9 +90,9 @@ String StringBuilder::toString() const p += length; } - ASSERT(p == m_totalLength + buffer.characters()); + ASSERT(p == m_totalLength + buffer); - return String::adopt(buffer); + return result; } } |