From 2f2d4da9dd031cdf9f8a0cadcbdffe38c2170353 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 24 Aug 2015 23:00:21 +0200 Subject: cmCTestScriptHandler: Simplify deletes. Deleting a nullptr is fine. --- Source/CTest/cmCTestScriptHandler.cxx | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 8327f29..4be5eb6 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -126,20 +126,14 @@ void cmCTestScriptHandler::Initialize() this->ScriptStartTime = 0; this->Makefile = 0; - if (this->LocalGenerator) - { - delete this->LocalGenerator; - } + + delete this->LocalGenerator; this->LocalGenerator = 0; - if (this->GlobalGenerator) - { - delete this->GlobalGenerator; - } + + delete this->GlobalGenerator; this->GlobalGenerator = 0; - if (this->CMake) - { - delete this->CMake; - } + + delete this->CMake; } //---------------------------------------------------------------------- @@ -147,20 +141,9 @@ cmCTestScriptHandler::~cmCTestScriptHandler() { // local generator owns the makefile this->Makefile = 0; - if (this->LocalGenerator) - { - delete this->LocalGenerator; - } - this->LocalGenerator = 0; - if (this->GlobalGenerator) - { - delete this->GlobalGenerator; - } - this->GlobalGenerator = 0; - if (this->CMake) - { - delete this->CMake; - } + delete this->LocalGenerator; + delete this->GlobalGenerator; + delete this->CMake; } -- cgit v0.12