Browse Source

[2726] Use more common check for assignment to self

This way cppcheck should recognize it as such.
Michal 'vorner' Vaner 12 years ago
parent
commit
78af6ba875

+ 1 - 1
src/lib/dns/rdata/any_255/tsig_250.cc

@@ -338,7 +338,7 @@ TSIG::TSIG(const TSIG& source) : Rdata(), impl_(new TSIGImpl(*source.impl_))
 
 TSIG&
 TSIG::operator=(const TSIG& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/dlv_32769.cc

@@ -62,7 +62,7 @@ DLV::DLV(const DLV& source) :
 /// PIMPL-induced logic
 DLV&
 DLV::operator=(const DLV& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/dnskey_48.cc

@@ -212,7 +212,7 @@ DNSKEY::DNSKEY(const DNSKEY& source) :
 
 DNSKEY&
 DNSKEY::operator=(const DNSKEY& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/ds_43.cc

@@ -50,7 +50,7 @@ DS::DS(const DS& source) :
 
 DS&
 DS::operator=(const DS& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/nsec3_50.cc

@@ -200,7 +200,7 @@ NSEC3::NSEC3(const NSEC3& source) :
 
 NSEC3&
 NSEC3::operator=(const NSEC3& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/nsec3param_51.cc

@@ -139,7 +139,7 @@ NSEC3PARAM::NSEC3PARAM(const NSEC3PARAM& source) :
 
 NSEC3PARAM&
 NSEC3PARAM::operator=(const NSEC3PARAM& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/nsec_47.cc

@@ -155,7 +155,7 @@ NSEC::NSEC(const NSEC& source) :
 
 NSEC&
 NSEC::operator=(const NSEC& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/rrsig_46.cc

@@ -230,7 +230,7 @@ RRSIG::RRSIG(const RRSIG& source) :
 
 RRSIG&
 RRSIG::operator=(const RRSIG& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/spf_99.cc

@@ -42,7 +42,7 @@ using namespace isc::util;
 /// This method never throws an exception otherwise.
 SPF&
 SPF::operator=(const SPF& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/sshfp_44.cc

@@ -199,7 +199,7 @@ SSHFP::SSHFP(const SSHFP& other) :
 
 SSHFP&
 SSHFP::operator=(const SSHFP& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/generic/txt_16.cc

@@ -33,7 +33,7 @@ using namespace isc::util;
 
 TXT&
 TXT::operator=(const TXT& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/rdata/in_1/srv_33.cc

@@ -190,7 +190,7 @@ SRV::SRV(const SRV& source) :
 
 SRV&
 SRV::operator=(const SRV& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }
 

+ 1 - 1
src/lib/dns/tsigkey.cc

@@ -148,7 +148,7 @@ TSIGKey::TSIGKey(const TSIGKey& source) : impl_(new TSIGKeyImpl(*source.impl_))
 
 TSIGKey&
 TSIGKey::operator=(const TSIGKey& source) {
-    if (impl_ == source.impl_) {
+    if (this == &source) {
         return (*this);
     }