]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
add makeUsRelative() to DNSName class
authorKees Monshouwer <mind04@monshouwer.org>
Sun, 4 Jun 2017 11:12:13 +0000 (13:12 +0200)
committermind04 <mind04@monshouwer.org>
Mon, 12 Jun 2017 19:16:45 +0000 (21:16 +0200)
pdns/dnsname.hh

index c57faf996fb05c04e199dfdb50f3169af2ede2d6..0c32afd1d7a3fccb21cacf54c7819cc1bce4132e 100644 (file)
@@ -83,12 +83,15 @@ public:
   DNSName makeRelative(const DNSName& zone) const;
   DNSName makeLowerCase() const
   {
-    DNSName ret;
-    ret.d_storage = d_storage;
-    for(auto & c : ret.d_storage) {
+    DNSName ret(*this);
+    ret.makeUsLowerCase();
+    return ret;
+  }
+  void makeUsLowerCase()
+  {
+    for(auto & c : d_storage) {
       c=dns_tolower(c);
     }
-    return ret;
   }
   void makeUsRelative(const DNSName& zone);
   DNSName labelReverse() const;