From 089e44f3db0bac39ff5cae85c19b600ad3a9a4ad Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Mon, 18 May 2015 21:40:11 +0200 Subject: [PATCH] Remove unnecessary checks for null before delete Closes #343 --- taglib/asf/asfproperties.cpp | 3 +-- taglib/asf/asftag.cpp | 3 +-- taglib/mp4/mp4file.cpp | 15 +++------------ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/taglib/asf/asfproperties.cpp b/taglib/asf/asfproperties.cpp index b82c131a..acec09d2 100644 --- a/taglib/asf/asfproperties.cpp +++ b/taglib/asf/asfproperties.cpp @@ -51,8 +51,7 @@ ASF::Properties::Properties() : AudioProperties(AudioProperties::Average) ASF::Properties::~Properties() { - if(d) - delete d; + delete d; } int ASF::Properties::length() const diff --git a/taglib/asf/asftag.cpp b/taglib/asf/asftag.cpp index 9317bc6a..13d92b5f 100644 --- a/taglib/asf/asftag.cpp +++ b/taglib/asf/asftag.cpp @@ -47,8 +47,7 @@ ASF::Tag::Tag() ASF::Tag::~Tag() { - if(d) - delete d; + delete d; } String ASF::Tag::title() const diff --git a/taglib/mp4/mp4file.cpp b/taglib/mp4/mp4file.cpp index aab1a2be..e3cb02a3 100644 --- a/taglib/mp4/mp4file.cpp +++ b/taglib/mp4/mp4file.cpp @@ -41,18 +41,9 @@ public: ~FilePrivate() { - if(atoms) { - delete atoms; - atoms = 0; - } - if(tag) { - delete tag; - tag = 0; - } - if(properties) { - delete properties; - properties = 0; - } + delete atoms; + delete tag; + delete properties; } MP4::Tag *tag;