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

Unified Diff: third_party/WebKit/WebCore/editing/TextIterator.cpp

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | « third_party/WebKit/WebCore/dom/WorkerThread.cpp ('k') | third_party/WebKit/WebCore/editing/markup.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/WebCore/editing/TextIterator.cpp
===================================================================
--- third_party/WebKit/WebCore/editing/TextIterator.cpp (revision 9118)
+++ third_party/WebKit/WebCore/editing/TextIterator.cpp (working copy)
@@ -1059,7 +1059,7 @@
String CharacterIterator::string(int numChars)
{
Vector<UChar> result;
- result.reserveCapacity(numChars);
+ result.reserveInitialCapacity(numChars);
while (numChars > 0 && !atEnd()) {
int runSize = min(numChars, length());
result.append(characters(), runSize);
@@ -1227,7 +1227,7 @@
ASSERT(!m_target.isEmpty());
size_t targetLength = target.length();
- m_buffer.reserveCapacity(max(targetLength * 8, minimumSearchBufferSize));
+ m_buffer.reserveInitialCapacity(max(targetLength * 8, minimumSearchBufferSize));
m_overlap = m_buffer.capacity() / 4;
// Grab the single global searcher.
@@ -1544,7 +1544,7 @@
typedef pair<UChar*, unsigned> TextSegment;
Vector<TextSegment>* textSegments = 0;
Vector<UChar> textBuffer;
- textBuffer.reserveCapacity(cMaxSegmentSize);
+ textBuffer.reserveInitialCapacity(cMaxSegmentSize);
for (TextIterator it(r); !it.atEnd(); it.advance()) {
if (textBuffer.size() && textBuffer.size() + it.length() > cMaxSegmentSize) {
UChar* newSegmentBuffer = static_cast<UChar*>(malloc(textBuffer.size() * sizeof(UChar)));
« no previous file with comments | « third_party/WebKit/WebCore/dom/WorkerThread.cpp ('k') | third_party/WebKit/WebCore/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698