Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MediaArea/ZenLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorpavel.pimenov <pavel.pimenov@gmail.com>2017-09-01 16:47:07 +0300
committerpavel.pimenov <pavel.pimenov@gmail.com>2017-09-01 16:47:07 +0300
commit14e5e52bec6eb1692c684d3e48f72f3bba3ee4c4 (patch)
tree3c962aea46075bba6c09431ee5e2291a7f27f846 /Source
parent3fbefa79e8047625731e14b3ef9e7c1018241ec1 (diff)
Fix operator=
https://www.viva64.com/en/w/V794/print/
Diffstat (limited to 'Source')
-rw-r--r--Source/ZenLib/ZtringList.cpp2
-rw-r--r--Source/ZenLib/ZtringListList.cpp2
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());