From 186e99c98d195329af05129cd4d6512657edf4bc Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 11 Jun 2019 14:47:53 +0200 Subject: [PATCH] rec: Compare the CacheKey type and place first then the name We don't care about the actual ordering, so let's do the cheapest comparisons first then the quite expensive DNSName comparison only if we really need to. --- pdns/syncres.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/syncres.cc b/pdns/syncres.cc index dcdcc1ce0b..baca8d53dd 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -1106,7 +1106,7 @@ struct CacheKey uint16_t type; DNSResourceRecord::Place place; bool operator<(const CacheKey& rhs) const { - return tie(name, type, place) < tie(rhs.name, rhs.type, rhs.place); + return tie(type, place, name) < tie(rhs.type, rhs.place, rhs.name); } }; typedef map tcache_t; -- 2.39.5