From: Senthil Kumar G S Date: Fri, 6 Jan 2017 13:15:55 +0000 (+0530) Subject: Minor static analysis bug fix. X-Git-Tag: 1.3.0~900 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a75c665bf29779ed64332a20d081e9f3bb75b4d5;p=platform%2Fupstream%2Fiotivity.git Minor static analysis bug fix. Solves the self assignment problem (x = x) which is reported by the static analysis tool(SVACE). Change-Id: I5d50dda1bc531501c619df7f29bf0e94758f3137 Signed-off-by: Senthil Kumar G S Reviewed-on: https://gerrit.iotivity.org/gerrit/16199 Reviewed-by: Phil Coval Reviewed-by: Abhishek Pandey Tested-by: jenkins-iotivity Reviewed-by: Harish Marappa Reviewed-by: Uze Choi --- diff --git a/service/resource-encapsulation/include/RCSResourceAttributes.h b/service/resource-encapsulation/include/RCSResourceAttributes.h index 3a1c4c9..0973af2 100644 --- a/service/resource-encapsulation/include/RCSResourceAttributes.h +++ b/service/resource-encapsulation/include/RCSResourceAttributes.h @@ -161,11 +161,14 @@ namespace OIC } inline RCSByteString& operator=(const RCSByteString& rhs) { - if (!m_data.empty()) + if(&rhs != this) { - m_data.clear(); + if (!m_data.empty()) + { + m_data.clear(); + } + m_data = DataType{rhs.getByteString()}; } - m_data = DataType{rhs.getByteString()}; return *this; } private: