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

Unified Diff: Source/platform/network/HTTPParsers.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/platform/network/HTTPParsers.cpp
diff --git a/Source/platform/network/HTTPParsers.cpp b/Source/platform/network/HTTPParsers.cpp
old mode 100644
new mode 100755
index e557188493514fe12aec80518c21f6f428266bd0..422fb7a8ff82f0d8c7cb1a3e45116f3f03715f71
--- a/Source/platform/network/HTTPParsers.cpp
+++ b/Source/platform/network/HTTPParsers.cpp
@@ -129,10 +129,11 @@ bool isValidHTTPToken(const String& characters)
static const size_t maxInputSampleSize = 128;
static String trimInputSample(const char* p, size_t length)
{
- String s = String(p, std::min<size_t>(length, maxInputSampleSize));
- if (length > maxInputSampleSize)
- s.append(horizontalEllipsis);
- return s;
+ if (length > maxInputSampleSize) {
+ String s = String(p, std::min<size_t>(length, maxInputSampleSize)) + horizontalEllipsis;
+ return s;
+ }
+ return String(p, std::min<size_t>(length, maxInputSampleSize));
}
ContentDispositionType contentDispositionType(const String& contentDisposition)

Powered by Google App Engine
This is Rietveld 408576698