From: Douglas Bagnall Date: Sun, 7 Jul 2019 00:34:37 +0000 (+1200) Subject: talloc/py_util: remove tautologically dead code X-Git-Tag: talloc-2.3.0~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac23eeb41c3d27d710722f94e22dd84410d183d3;p=thirdparty%2Fsamba.git talloc/py_util: remove tautologically dead code 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 Reviewed-by: Gary Lockyer Reviewed-by: Andrew Bartlett --- diff --git a/lib/talloc/pytalloc_util.c b/lib/talloc/pytalloc_util.c index 4193ca895ce..c1a41e958d4 100644 --- a/lib/talloc/pytalloc_util.c +++ b/lib/talloc/pytalloc_util.c @@ -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;