]> granicus.if.org Git - taglib/commitdiff
Remove unnecessary checks for null before delete
authorScott Wheeler <scott@directededge.com>
Mon, 18 May 2015 19:40:11 +0000 (21:40 +0200)
committerScott Wheeler <scott@directededge.com>
Mon, 18 May 2015 19:40:21 +0000 (21:40 +0200)
Closes #343

taglib/asf/asfproperties.cpp
taglib/asf/asftag.cpp
taglib/mp4/mp4file.cpp

index b82c131a70fa83d42977a6a43a113c692ea958f9..acec09d2529a4b471c9f6c75a7581eef1a076a2e 100644 (file)
@@ -51,8 +51,7 @@ ASF::Properties::Properties() : AudioProperties(AudioProperties::Average)
 
 ASF::Properties::~Properties()
 {
-  if(d)
-    delete d;
+  delete d;
 }
 
 int ASF::Properties::length() const
index 9317bc6ab8ceaad4b0d4a55f25516b07c27f1df5..13d92b5ffd8efdf405f030574c8feb7c38949812 100644 (file)
@@ -47,8 +47,7 @@ ASF::Tag::Tag()
 
 ASF::Tag::~Tag()
 {
-  if(d)
-    delete d;
+  delete d;
 }
 
 String ASF::Tag::title() const
index aab1a2bea1637b02d384412e7b8008586e855511..e3cb02a3293cb872a86dbd42f464add02defd2be 100644 (file)
@@ -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;