]> granicus.if.org Git - pdns/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>
Sun, 4 Jun 2017 23:21:13 +0000 (01:21 +0200)
pdns/dnsname.hh

index 3e7ab1df696dbe9c494e5fd205232a639d2f1c5e..fa7f46a8d601536a073b373bf3d7f02e856f41b8 100644 (file)
@@ -86,12 +86,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=dns2_tolower(c);
     }
-    return ret;
   }
   void makeUsRelative(const DNSName& zone);
   DNSName labelReverse() const;