mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 13:43:15 +00:00
Help compilers optimize Object::cast_to()
This commit is contained in:
parent
72a31722fd
commit
fdc47adf1e
@ -798,12 +798,12 @@ public:
|
||||
|
||||
template <class T>
|
||||
static T *cast_to(Object *p_object) {
|
||||
return dynamic_cast<T *>(p_object);
|
||||
return p_object ? dynamic_cast<T *>(p_object) : nullptr;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static const T *cast_to(const Object *p_object) {
|
||||
return dynamic_cast<const T *>(p_object);
|
||||
return p_object ? dynamic_cast<const T *>(p_object) : nullptr;
|
||||
}
|
||||
|
||||
enum {
|
||||
|
Loading…
Reference in New Issue
Block a user