From f8cb9f5516cd8081a8a887afdb459cb9d1ff7f16 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Mon, 4 Sep 2017 22:29:43 +0200 Subject: Remove NULL check from Object::cast_to() After discussing this with @reduz on IRC we agreed to remove these checks. We now consider cast_to() to be NULL safe --- core/object.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/object.h b/core/object.h index 6e1ed4308e..644e2b8270 100644 --- a/core/object.h +++ b/core/object.h @@ -567,12 +567,6 @@ public: template static T *cast_to(Object *p_object) { -#ifdef DEBUG_ENABLED - // TODO there are some legitimate reasons to pass NULL as p_object. - // we need to figure out how to deal with that in debug mode. - // This code will return NULL for a NULL input in release mode also. - ERR_FAIL_COND_V(p_object == NULL, NULL); -#endif #ifndef NO_SAFE_CAST return dynamic_cast(p_object); #else @@ -587,12 +581,6 @@ public: template static const T *cast_to(const Object *p_object) { -#ifdef DEBUG_ENABLED - // TODO there are some legitimate reasons to pass NULL as p_object. - // we need to figure out how to deal with that in debug mode. - // This code will return NULL for a NULL input in release mode also. - ERR_FAIL_COND_V(p_object == NULL, NULL); -#endif #ifndef NO_SAFE_CAST return dynamic_cast(p_object); #else -- cgit v1.2.3