]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Remove redundant NULL checks in PySerial
authorMukund Sivaraman <muks@isc.org>
Thu, 13 Sep 2012 09:52:22 +0000 (15:22 +0530)
committerMukund Sivaraman <muks@isc.org>
Thu, 13 Sep 2012 10:05:51 +0000 (15:35 +0530)
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.

src/lib/dns/python/serial_python.cc

index e2bd809219daba877d778bee5ac92344719321b9..f4f4720df5447d80365853c24672e28b553a175e 100644 (file)
@@ -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);
 }