From 2d97a4b9d7c6d84cb8b22302cd22f805a4ab76b0 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 29 Jan 2024 21:53:25 +0100 Subject: Apply readability-delete-null-pointer fixits These checks are unnecessary as deleting a null pointer has no effect. --- src/gui/setup_players.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/gui/setup_players.cpp') diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index fe72a29c..529e69a5 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -127,8 +127,8 @@ public: signalBeforeUpdate(); freeWidgets(); - if (mPlayers) - delete mPlayers; + + delete mPlayers; mPlayers = player_relations.getPlayers(); // set up widgets @@ -162,8 +162,7 @@ public: virtual void freeWidgets() { - if (mPlayers) - delete mPlayers; + delete mPlayers; mPlayers = nullptr; delete_all(mWidgets); -- cgit v1.2.3-70-g09d2