summaryrefslogtreecommitdiff
path: root/src/option.cpp
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-10-19 11:45:12 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-10-24 22:42:07 +0800
commit62e557ec650006f2d3dd614f84804ed1b5cd4349 (patch)
tree369b8c0d95bb3235eaacd520cc6c7aba1d0f5568 /src/option.cpp
parent6f4cb23385f8818f4373c939f241f1a20596870a (diff)
downloadunity-window-decorator-62e557ec650006f2d3dd614f84804ed1b5cd4349.tar.gz
unity-window-decorator-62e557ec650006f2d3dd614f84804ed1b5cd4349.tar.bz2
core: general code cleanup (static analysis)
Diffstat (limited to 'src/option.cpp')
-rw-r--r--src/option.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/option.cpp b/src/option.cpp
index 1fb69f0..2de2f9e 100644
--- a/src/option.cpp
+++ b/src/option.cpp
@@ -409,6 +409,9 @@ CompOption::Value::operator!= (const CompOption::Value &val)
CompOption::Value &
CompOption::Value::operator= (const CompOption::Value &val)
{
+ if (this == &val)
+ return *this;
+
delete priv;
priv = new PrivateValue (*val.priv);
@@ -581,6 +584,9 @@ CompOption::Restriction::inRange (float f)
CompOption::Restriction &
CompOption::Restriction::operator= (const CompOption::Restriction &rest)
{
+ if (this == &rest)
+ return *this;
+
delete priv;
priv = new PrivateRestriction (*rest.priv);
return *this;
@@ -800,6 +806,9 @@ CompOption::isAction ()
CompOption &
CompOption::operator= (const CompOption &option)
{
+ if (this == &option)
+ return *this;
+
delete priv;
priv = new PrivateOption (*option.priv);
return *this;