]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
minor coverity defects: self-assignment protection
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Nov 2011 09:55:35 +0000 (09:55 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Nov 2011 09:55:35 +0000 (09:55 +0000)
HLT/BASE/AliHLTOUT.cxx
HLT/BASE/AliHLTOUT.h

index cc6688ba8cbb3c443120408bd15d8e7159e1c653..f41cb27918eda201b2f19bcf50ec58379d7aa24a 100644 (file)
@@ -481,6 +481,7 @@ AliHLTOUT::AliHLTOUTHandlerListEntry::~AliHLTOUTHandlerListEntry()
 AliHLTOUT::AliHLTOUTHandlerListEntry& AliHLTOUT::AliHLTOUTHandlerListEntry::operator=(const AliHLTOUTHandlerListEntry& src)
 {
   // see header file for class documentation
+  if (this==&src) return *this;  
   fpHandler=src.fpHandler;
   if (src.fpHandlerDesc)
     *fpHandlerDesc=*src.fpHandlerDesc;
index 2cc190dd23ba858676bb6b31c4cbd4c60eb7a172..c9c5dc6ecadb4ef9c9257dbcb344c451742595b8 100644 (file)
@@ -187,8 +187,10 @@ class AliHLTOUT {
       : fDataType(dt), fSpecification(spec), fIndex(index), fSelected(false), fProcessed(false), fpCollection(pCollection) {};
     AliHLTOUTBlockDescriptor(const AliHLTOUTBlockDescriptor& src)
       : fDataType(src.fDataType), fSpecification(src.fSpecification), fIndex(src.fIndex), fSelected(false), fProcessed(false), fpCollection(src.fpCollection) {}
-    AliHLTOUTBlockDescriptor& operator=(const AliHLTOUTBlockDescriptor& src)
-    { fDataType=src.fDataType; fSpecification=src.fSpecification; fIndex=src.fIndex; fSelected=false; fProcessed=false; fpCollection=src.fpCollection; return *this; }
+    AliHLTOUTBlockDescriptor& operator=(const AliHLTOUTBlockDescriptor& src) {
+      if (this==&src) return *this;
+      fDataType=src.fDataType; fSpecification=src.fSpecification; fIndex=src.fIndex; fSelected=false; fProcessed=false; fpCollection=src.fpCollection; return *this;
+    }
     ~AliHLTOUTBlockDescriptor() {}
 
     operator AliHLTComponentDataType() const {return fDataType;}