talloc/py_util: remove tautologically dead code
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 7 Jul 2019 00:34:37 +0000 (12:34 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 22 Jul 2019 22:20:25 +0000 (22:20 +0000)
Being careful is good and all, but if we don't trust the

       static PyTypeObject *type = NULL;

two lines up, we need to reconsider our entire software universe.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/talloc/pytalloc_util.c

index 4193ca895ce3d2752c8c53802b65be8d984e7e02..c1a41e958d4d8b7bfda29144d968f31326c90ab9 100644 (file)
@@ -32,10 +32,6 @@ _PUBLIC_ PyTypeObject *pytalloc_GetObjectType(void)
        static PyTypeObject *type = NULL;
        PyObject *mod;
 
-       if (type != NULL) {
-               return type;
-       }
-
        mod = PyImport_ImportModule("talloc");
        if (mod == NULL) {
                return NULL;
@@ -52,10 +48,6 @@ _PUBLIC_ PyTypeObject *pytalloc_GetBaseObjectType(void)
        static PyTypeObject *type = NULL;
        PyObject *mod;
 
-       if (type != NULL) {
-               return type;
-       }
-
        mod = PyImport_ImportModule("talloc");
        if (mod == NULL) {
                return NULL;
@@ -72,10 +64,6 @@ static PyTypeObject *pytalloc_GetGenericObjectType(void)
        static PyTypeObject *type = NULL;
        PyObject *mod;
 
-       if (type != NULL) {
-               return type;
-       }
-
        mod = PyImport_ImportModule("talloc");
        if (mod == NULL) {
                return NULL;