diff options
author | pavel.pimenov <pavel.pimenov@gmail.com> | 2017-09-01 16:47:07 +0300 |
---|---|---|
committer | pavel.pimenov <pavel.pimenov@gmail.com> | 2017-09-01 16:47:07 +0300 |
commit | 14e5e52bec6eb1692c684d3e48f72f3bba3ee4c4 (patch) | |
tree | 3c962aea46075bba6c09431ee5e2291a7f27f846 /Source | |
parent | 3fbefa79e8047625731e14b3ef9e7c1018241ec1 (diff) |
Fix operator=
https://www.viva64.com/en/w/V794/print/
Diffstat (limited to 'Source')
-rw-r--r-- | Source/ZenLib/ZtringList.cpp | 2 | ||||
-rw-r--r-- | Source/ZenLib/ZtringListList.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Source/ZenLib/ZtringList.cpp b/Source/ZenLib/ZtringList.cpp index a58f9fd..e9a3a73 100644 --- a/Source/ZenLib/ZtringList.cpp +++ b/Source/ZenLib/ZtringList.cpp @@ -113,6 +113,8 @@ ZtringList &ZtringList::operator+= (const ZtringList &Source) // Operator =
ZtringList &ZtringList::operator= (const ZtringList &Source)
{
+ if (this == &Source)
+ return *this;
clear();
Ztring C=Separator[0];
Ztring Q=Quote;
diff --git a/Source/ZenLib/ZtringListList.cpp b/Source/ZenLib/ZtringListList.cpp index 0b7585a..54c6a94 100644 --- a/Source/ZenLib/ZtringListList.cpp +++ b/Source/ZenLib/ZtringListList.cpp @@ -131,6 +131,8 @@ ZtringListList &ZtringListList::operator+= (const ZtringListList &Source) // Operator =
ZtringListList &ZtringListList::operator= (const ZtringListList &Source)
{
+ if (this == &Source)
+ return *this;
clear();
reserve(Source.size());
|