From: Peter van Dijk Date: Thu, 16 May 2013 11:49:46 +0000 (+0200) Subject: add inline operators for qtype comparison, thanks Mark Zealey. Closes #646 X-Git-Tag: auth-3.3-rc1~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df9b53dbcdc60ae33e1382b41ecedad7ae77e2d9;p=thirdparty%2Fpdns.git add inline operators for qtype comparison, thanks Mark Zealey. Closes #646 --- diff --git a/pdns/qtype.cc b/pdns/qtype.cc index 35d422b65d..3b00d6ab33 100644 --- a/pdns/qtype.cc +++ b/pdns/qtype.cc @@ -80,11 +80,6 @@ QType &QType::operator=(const char *p) return *this; } -bool QType::operator==(const QType &comp) const -{ - return(comp.code==code); -} - QType &QType::operator=(const string &s) { code=chartocode(s.c_str()); diff --git a/pdns/qtype.hh b/pdns/qtype.hh index 4d063ed063..8ce807f779 100644 --- a/pdns/qtype.hh +++ b/pdns/qtype.hh @@ -69,8 +69,6 @@ public: ar & code; } - bool operator==(const QType &) const; //!< equality operator - const string getName() const; //!< Get a string representation of this type uint16_t getCode() const; //!< Get the integer representation of this type @@ -83,6 +81,22 @@ public: typedef pair namenum; static vector names; + inline bool operator==(const QType &comp) const { + return(comp.code==code); + } + + inline bool operator!=(const QType &comp) const { + return(comp.code!=code); + } + + inline bool operator==(QType::typeenum comp) const { + return(comp==code); + } + + inline bool operator!=(QType::typeenum comp) const { + return(comp!=code); + } + private: static class init { public: