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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 745373002: Optimized HostPortPair::ToString and CookieMonster::GetAllCookiesForURLWithOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « net/cookies/cookie_monster.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_impl.cc
diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc
index 1bf541bf0ea68607dc384d7f2f5c1bb266db827b..f1efa195fc6f374ec4bf65bb3b89c5f15008e3ec 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -9,6 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -131,9 +132,10 @@ void HttpServerPropertiesImpl::GetSpdyServerList(
std::string HttpServerPropertiesImpl::GetFlattenedSpdyServer(
const net::HostPortPair& host_port_pair) {
std::string spdy_server;
- spdy_server.append(host_port_pair.host());
+ spdy_server.reserve(host_port_pair.host().length() + 7);
+ spdy_server.assign(host_port_pair.host());
spdy_server.append(":");
- base::StringAppendF(&spdy_server, "%d", host_port_pair.port());
+ spdy_server.append(base::IntToString(host_port_pair.port()));
Ryan Sleevi 2014/12/01 16:28:51 Not LGTM. I don't like line 135 because, as a pro
Ryan Hamilton 2014/12/01 20:14:53 I agree with everything sleevi said. I'd be inclin
return spdy_server;
}
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698