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

Unified Diff: Source/modules/filesystem/DOMFilePath.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: Incorporated review comments 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/modules/filesystem/DOMFilePath.cpp
diff --git a/Source/modules/filesystem/DOMFilePath.cpp b/Source/modules/filesystem/DOMFilePath.cpp
old mode 100644
new mode 100755
index fd5b8077e2dcbbd04697b34c9d110943c6ca885e..0bfa2eee091e21753349f0ae1a67420825915972
--- a/Source/modules/filesystem/DOMFilePath.cpp
+++ b/Source/modules/filesystem/DOMFilePath.cpp
@@ -33,6 +33,7 @@
#include "wtf/Vector.h"
#include "wtf/text/CString.h"
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -47,8 +48,7 @@ String DOMFilePath::append(const String& base, const String& components)
String DOMFilePath::ensureDirectoryPath(const String& path)
{
if (!DOMFilePath::endsWithSeparator(path)) {
- String newPath = path;
- newPath.append(DOMFilePath::separator);
+ String newPath = path + DOMFilePath::separator;
return newPath;
abarth-chromium 2014/01/09 15:48:24 I'd just merge these two lines.
}
return path;
@@ -103,12 +103,12 @@ String DOMFilePath::removeExtraParentReferences(const String& path)
}
if (canonicalized.isEmpty())
return DOMFilePath::root;
- String result;
+ StringBuilder result;
for (size_t i = 0; i < canonicalized.size(); ++i) {
result.append(DOMFilePath::separator);
result.append(canonicalized[i]);
}
- return result;
+ return result.toString();
}
bool DOMFilePath::isValidPath(const String& path)

Powered by Google App Engine
This is Rietveld 408576698