Skip to content

Commit

Permalink
misc: Use boost::ends_with() in isCanonical instead of open-coding
Browse files Browse the repository at this point in the history
boost:ends_with(qname, ".") behaves exactly as isCanonical(qname)
should. So use the first to implement the latter.
  • Loading branch information
ukleinek committed Dec 18, 2024
1 parent ae6d458 commit a878c70
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pdns/misc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,7 @@ pair<string, string> splitField(const string& inp, char sepa);

inline bool isCanonical(const string& qname)
{
if(qname.empty())
return false;
return qname[qname.size()-1]=='.';
return boost::ends_with(qname, ".");
}

inline DNSName toCanonic(const DNSName& zone, const string& qname)
Expand Down

0 comments on commit a878c70

Please sign in to comment.