]> granicus.if.org Git - pdns/commitdiff
qtype speedup - lack of a direct copy constructor caused heaps of string conversions
authorBert Hubert <bert.hubert@netherlabs.nl>
Fri, 11 Nov 2005 11:24:21 +0000 (11:24 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Fri, 11 Nov 2005 11:24:21 +0000 (11:24 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@540 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/qtype.hh

index cacf3d6b68ecd0bd6aa6e8e874792b8bec1f57ef..bcf539cf1529e8aec16066e6be5f8e203f5a0c6f 100644 (file)
@@ -48,10 +48,17 @@ public:
   QType(); //!< Naked constructor
   explicit QType(int); //!< convert from an integer to a QType
   QType(const char *p);  //!< convert from a char* to a QType
-
+  QType(const QType& orig) : code(orig.code)
+  {
+  }
   QType &operator=(int);  //!< Assigns integers to us
   QType &operator=(const char *); //!< Assings strings to us
   QType &operator=(const string &); //!< Assings strings to us
+  QType &operator=(const QType&rhs)  //!< Assings strings to us
+  {
+    code=rhs.code;
+    return *this;
+  }
   bool operator==(const QType &) const; //!< equality operator
 
   const string getName() const; //!< Get a string representation of this type