Parcourir la source

[master] Remove redundant NULL checks in PySerial

These are not required according to:
http://docs.python.org/py3k/extending/extending.html?highlight=null#null-pointers

These NULL checks cause static analysis reports in other parts of the
code where the pointers are not NULL tested before use.
Mukund Sivaraman il y a 12 ans
Parent
commit
ccdbcf02d9
1 fichiers modifiés avec 0 ajouts et 8 suppressions
  1. 0 8
      src/lib/dns/python/serial_python.cc

+ 0 - 8
src/lib/dns/python/serial_python.cc

@@ -259,19 +259,11 @@ createSerialObject(const Serial& source) {
 
 bool
 PySerial_Check(PyObject* obj) {
-    if (obj == NULL) {
-        isc_throw(PyCPPWrapperException,
-                  "obj argument NULL in Serial typecheck");
-    }
     return (PyObject_TypeCheck(obj, &serial_type));
 }
 
 const Serial&
 PySerial_ToSerial(const PyObject* serial_obj) {
-    if (serial_obj == NULL) {
-        isc_throw(PyCPPWrapperException,
-                  "obj argument NULL in Serial PyObject conversion");
-    }
     const s_Serial* serial = static_cast<const s_Serial*>(serial_obj);
     return (*serial->cppobj);
 }