Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
mutable bool auth;
bool operator<(const Bind2DNSRecord& rhs) const
{
- if (qname.canonCompare(rhs.qname))
- return true;
- if (rhs.qname.canonCompare(qname))
- return false;
+ if (int rc = qname.canonCompare_three_way(rhs.qname); rc != 0) {
+ return rc < 0;
+ }
if (qtype == QType::SOA && rhs.qtype != QType::SOA)
return true;
return std::tie(qtype, content, ttl) < std::tie(rhs.qtype, rhs.content, rhs.ttl);
{
bool operator()(const RRSetKey_t& lhs, const RRSetKey_t& rhs) const
{
- // FIXME surely we can be smarter here
- if (lhs.first.canonCompare(rhs.first)) {
- return true;
- }
- if (rhs.first.canonCompare(lhs.first)) {
- return false;
+ if (int rc = lhs.first.canonCompare_three_way(rhs.first); rc != 0) {
+ return rc < 0;
}
return lhs.second < rhs.second;
}