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

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..93e11da6a6a909a44014777b5f34482c3375e5b8
--- 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, maxInputSampleSize) + horizontalEllipsis;
+ return s;
abarth-chromium 2014/01/09 15:48:24 I'd merge these two lines.
+ }
+ return String(p, length);
}
ContentDispositionType contentDispositionType(const String& contentDisposition)

Powered by Google App Engine
This is Rietveld 408576698