check for self-assignment in operator=
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
69cc4323fd
commit
7c562ad9aa
@ -182,8 +182,11 @@ inline wxPoint2DInt wxPoint2DInt::operator-()
|
||||
|
||||
inline wxPoint2DInt& wxPoint2DInt::operator=(const wxPoint2DInt& pt)
|
||||
{
|
||||
m_x = pt.m_x;
|
||||
m_y = pt.m_y;
|
||||
if (this != &pt)
|
||||
{
|
||||
m_x = pt.m_x;
|
||||
m_y = pt.m_y;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -411,8 +414,11 @@ inline wxPoint2DDouble wxPoint2DDouble::operator-()
|
||||
|
||||
inline wxPoint2DDouble& wxPoint2DDouble::operator=(const wxPoint2DDouble& pt)
|
||||
{
|
||||
m_x = pt.m_x;
|
||||
m_y = pt.m_y;
|
||||
if (this != &pt)
|
||||
{
|
||||
m_x = pt.m_x;
|
||||
m_y = pt.m_y;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user