summaryrefslogtreecommitdiffstats
path: root/labb4/GameState.cpp
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-11-10 15:33:46 +0100
committerGustav Sörnäs <gustav@sornas.net>2020-11-10 15:33:46 +0100
commit6f5cb7a9babdf57f5eae54fb468773857f48ecdd (patch)
tree2b2c27e5ec90dde99956d065400fc39fd7324f4e /labb4/GameState.cpp
parentc3028edebab1d021d2d95a26beea3ccd58a4e28f (diff)
downloadtddd86-6f5cb7a9babdf57f5eae54fb468773857f48ecdd.tar.gz
copy assignment return when this == &other
Diffstat (limited to 'labb4/GameState.cpp')
-rw-r--r--labb4/GameState.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/labb4/GameState.cpp b/labb4/GameState.cpp
index a21e49c..120e91a 100644
--- a/labb4/GameState.cpp
+++ b/labb4/GameState.cpp
@@ -35,6 +35,7 @@ GameState::~GameState() {
}
GameState& GameState::operator=(const GameState& other) {
+ if (this == &other) return *this;
for (const auto& robot : robots) {
delete robot;
}