Optimize Node::is_readable_from_caller_thread() by prioritizing the most common case.

This commit is contained in:
CrazyRoka 2024-07-11 20:40:00 +01:00
parent 383a6e4ef2
commit 53e9d90850

View File

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