Merge pull request #94230 from CrazyRoka/optimize-gdscript-get-position

Optimize `Node::is_readable_from_caller_thread()` by prioritizing the most common case
This commit is contained in:
Rémi Verschelde 2024-07-19 11:10:43 +02:00
commit edefcf6d1e
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -596,7 +596,7 @@ public:
// No thread processing.
// Only accessible if node is outside the scene tree
// or access will happen from a node-safe thread.
return !data.inside_tree || is_current_thread_safe_for_nodes();
return is_current_thread_safe_for_nodes() || unlikely(!data.inside_tree);
} else {
// Thread processing.
return true;