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

Unified Diff: Source/modules/websockets/WebSocketHandshake.cpp

Issue 134873010: Removed '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
« no previous file with comments | « Source/core/loader/FormSubmission.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WebSocketHandshake.cpp
diff --git a/Source/modules/websockets/WebSocketHandshake.cpp b/Source/modules/websockets/WebSocketHandshake.cpp
index b0ed328eb15260c46a096eeea958649db3264814..e5e728fcfeb9b3abed681026a3b762206b22c466 100644
--- a/Source/modules/websockets/WebSocketHandshake.cpp
+++ b/Source/modules/websockets/WebSocketHandshake.cpp
@@ -104,10 +104,9 @@ static String hostName(const KURL& url, bool secure)
static const size_t maxInputSampleSize = 128;
static String trimInputSample(const char* p, size_t len)
{
- String s = String(p, std::min<size_t>(len, maxInputSampleSize));
if (len > maxInputSampleSize)
- s.append(horizontalEllipsis);
- return s;
+ return String(p, maxInputSampleSize) + horizontalEllipsis;
+ return String(p, len);
}
static String generateSecWebSocketKey()
« no previous file with comments | « Source/core/loader/FormSubmission.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698