diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/include/gdnative/gdnative.h | 2 | ||||
-rw-r--r-- | modules/gdscript/gd_function.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 1c5e91d733..18d51daeb3 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -103,7 +103,7 @@ typedef enum { GODOT_ERR_CANT_CONNECT, // (25) GODOT_ERR_CANT_RESOLVE, GODOT_ERR_CONNECTION_ERROR, - GODOT_ERR_CANT_AQUIRE_RESOURCE, + GODOT_ERR_CANT_ACQUIRE_RESOURCE, GODOT_ERR_CANT_FORK, GODOT_ERR_INVALID_DATA, ///< Data passed is invalid (30) GODOT_ERR_INVALID_PARAMETER, ///< Parameter passed is invalid diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index df7b16c96e..70340f0823 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -42,7 +42,7 @@ Variant *GDFunction::_get_variant(int p_address, GDInstance *p_instance, GDScrip case ADDR_TYPE_SELF: { - if (!p_instance) { + if (unlikely(!p_instance)) { r_error = "Cannot access self without instance."; return NULL; } @@ -54,7 +54,7 @@ Variant *GDFunction::_get_variant(int p_address, GDInstance *p_instance, GDScrip } break; case ADDR_TYPE_MEMBER: { //member indexing is O(1) - if (!p_instance) { + if (unlikely(!p_instance)) { r_error = "Cannot access member without instance."; return NULL; } @@ -279,7 +279,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a #define GET_VARIANT_PTR(m_v, m_code_ofs) \ Variant *m_v; \ m_v = _get_variant(_code_ptr[ip + m_code_ofs], p_instance, _class, self, stack, err_text); \ - if (!m_v) \ + if (unlikely(!m_v)) \ break; #else |