Parcourir la source

removed redundant null checks before delete.
should be trivial enough, skipping review.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@2604 e5f2f494-b856-4b98-b285-d166d9295462

JINMEI Tatuya il y a 14 ans
Parent
commit
0043299b12

+ 1 - 2
src/lib/dns/python/message_python.cc

@@ -1192,8 +1192,7 @@ Message_init(s_Message* self, PyObject* args) {
 
 
 static void
 static void
 Message_destroy(s_Message* self) {
 Message_destroy(s_Message* self) {
-    if (self->message != NULL)
-        delete self->message;
+    delete self->message;
     self->message = NULL;
     self->message = NULL;
     Py_TYPE(self)->tp_free(self);
     Py_TYPE(self)->tp_free(self);
 }
 }

+ 1 - 2
src/lib/dns/python/rrclass_python.cc

@@ -201,8 +201,7 @@ RRClass_init(s_RRClass* self, PyObject* args) {
 
 
 static void
 static void
 RRClass_destroy(s_RRClass* self) {
 RRClass_destroy(s_RRClass* self) {
-    if (self->rrclass != NULL)
-        delete self->rrclass;
+    delete self->rrclass;
     self->rrclass = NULL;
     self->rrclass = NULL;
     Py_TYPE(self)->tp_free(self);
     Py_TYPE(self)->tp_free(self);
 }
 }

+ 1 - 2
src/lib/dns/python/rrttl_python.cc

@@ -199,8 +199,7 @@ RRTTL_init(s_RRTTL* self, PyObject* args) {
 
 
 static void
 static void
 RRTTL_destroy(s_RRTTL* self) {
 RRTTL_destroy(s_RRTTL* self) {
-    if (self->rrttl != NULL)
-        delete self->rrttl;
+    delete self->rrttl;
     self->rrttl = NULL;
     self->rrttl = NULL;
     Py_TYPE(self)->tp_free(self);
     Py_TYPE(self)->tp_free(self);
 }
 }

+ 1 - 2
src/lib/dns/python/rrtype_python.cc

@@ -239,8 +239,7 @@ RRType_init(s_RRType* self, PyObject* args) {
 
 
 static void
 static void
 RRType_destroy(s_RRType* self) {
 RRType_destroy(s_RRType* self) {
-    if (self->rrtype != NULL)
-        delete self->rrtype;
+    delete self->rrtype;
     self->rrtype = NULL;
     self->rrtype = NULL;
     Py_TYPE(self)->tp_free(self);
     Py_TYPE(self)->tp_free(self);
 }
 }