diff options
| author | Hein-Pieter van Braam | 2017-09-20 11:04:50 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2017-09-21 18:28:28 +0200 |
| commit | 22358babda1452ee6db4d662dff373472b93fdc6 (patch) | |
| tree | f47c0c224ef12098147a3e289de7410758043fc2 /modules | |
| parent | 4664d03a0e39be6dc8f5ba8154e1d6b776fa2293 (diff) | |
| download | godot-22358babda1452ee6db4d662dff373472b93fdc6.tar.gz godot-22358babda1452ee6db4d662dff373472b93fdc6.tar.zst godot-22358babda1452ee6db4d662dff373472b93fdc6.zip | |
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/gdscript/gd_function.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index df7b16c96..70340f082 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 |
