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

Unified Diff: Source/core/editing/markup.cpp

Issue 124943003: Remove 'String::append' from some of the blink source. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/core/editing/markup.cpp
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
old mode 100644
new mode 100755
index a2198a974293076c81200c779182c640c3e28e1f..efa37c21e179e2c134c620d4f52f7caa279bb62c
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -757,7 +757,7 @@ static void fillContainerFromString(ContainerNode* paragraph, const String& stri
Vector<String> tabList;
string.split('\t', true, tabList);
- String tabText = emptyString();
+ StringBuilder tabText;
bool first = true;
size_t numEntries = tabList.size();
for (size_t i = 0; i < numEntries; ++i) {
@@ -766,8 +766,8 @@ static void fillContainerFromString(ContainerNode* paragraph, const String& stri
// append the non-tab textual part
if (!s.isEmpty()) {
if (!tabText.isEmpty()) {
- paragraph->appendChild(createTabSpanElement(document, tabText));
- tabText = emptyString();
+ paragraph->appendChild(createTabSpanElement(document, tabText.toString()));
+ tabText.clear();
}
RefPtr<Node> textNode = document.createTextNode(stringWithRebalancedWhitespace(s, first, i + 1 == numEntries));
paragraph->appendChild(textNode.release());
@@ -778,7 +778,7 @@ static void fillContainerFromString(ContainerNode* paragraph, const String& stri
if (i + 1 != numEntries)
tabText.append('\t');
else if (!tabText.isEmpty())
- paragraph->appendChild(createTabSpanElement(document, tabText));
+ paragraph->appendChild(createTabSpanElement(document, tabText.toString()));
first = false;
}
« no previous file with comments | « no previous file | Source/core/fetch/CSSStyleSheetResource.cpp » ('j') | Source/core/fetch/CSSStyleSheetResource.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698