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

Unified Diff: net/dns/dns_hosts.cc

Issue 899433008: DNS: Don't use forbidden non-const reference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_hosts.cc
diff --git a/net/dns/dns_hosts.cc b/net/dns/dns_hosts.cc
index b4d213b80c451fa24935473b53a720732f8ede7e..047add27053ef1ad9d5f2b0283a35002339642a3 100644
--- a/net/dns/dns_hosts.cc
+++ b/net/dns/dns_hosts.cc
@@ -131,7 +131,6 @@ void ParseHostsWithCommaMode(const std::string& contents,
DnsHosts* dns_hosts,
ParseHostsCommaMode comma_mode) {
CHECK(dns_hosts);
- DnsHosts& hosts = *dns_hosts;
StringPiece ip_text;
IPAddressNumber ip;
@@ -156,7 +155,7 @@ void ParseHostsWithCommaMode(const std::string& contents,
} else {
DnsHostsKey key(parser.token().as_string(), family);
base::StringToLowerASCII(&key.first);
- IPAddressNumber& mapped_ip = hosts[key];
+ IPAddressNumber& mapped_ip = (*dns_hosts)[key];
davidben 2015/02/03 21:20:32 There's another one here too. :-)
Deprecated (see juliatuttle) 2015/02/03 22:12:11 Done.
if (mapped_ip.empty())
mapped_ip = ip;
// else ignore this entry (first hit counts)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698