diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-11-10 15:33:46 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-11-10 15:33:46 +0100 |
| commit | 6f5cb7a9babdf57f5eae54fb468773857f48ecdd (patch) | |
| tree | 2b2c27e5ec90dde99956d065400fc39fd7324f4e /labb4/GameState.cpp | |
| parent | c3028edebab1d021d2d95a26beea3ccd58a4e28f (diff) | |
| download | tddd86-6f5cb7a9babdf57f5eae54fb468773857f48ecdd.tar.gz | |
copy assignment return when this == &other
Diffstat (limited to 'labb4/GameState.cpp')
| -rw-r--r-- | labb4/GameState.cpp | 1 |
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; } |
