From 60cf7c9ce8cc0b34e9a7768db0c2550eb7cf1e78 Mon Sep 17 00:00:00 2001 From: "eroman@chromium.org" Date: Mon, 26 Oct 2009 20:35:02 +0000 Subject: Fix a bad comparator. This caused lookups in std::map to be wrong. BUG=25823 TEST=HostCacheTest.KeyComparator Review URL: http://codereview.chromium.org/338023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30084 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/host_cache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'net/base/host_cache.h') diff --git a/net/base/host_cache.h b/net/base/host_cache.h index 538f7ef..b36af35 100644 --- a/net/base/host_cache.h +++ b/net/base/host_cache.h @@ -42,9 +42,9 @@ class HostCache { } bool operator<(const Key& other) const { - if (address_family < other.address_family) - return true; - return hostname < other.hostname; + if (address_family == other.address_family) + return hostname < other.hostname; + return address_family < other.address_family; } std::string hostname; -- cgit v1.1