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 <senthil.gs@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16199
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Harish Marappa <h.marappa@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
}
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: