From 53e9d908506dc0edc5dcf149da6bddd0a64df4c5 Mon Sep 17 00:00:00 2001 From: CrazyRoka Date: Thu, 11 Jul 2024 20:40:00 +0100 Subject: [PATCH] Optimize Node::is_readable_from_caller_thread() by prioritizing the most common case. --- scene/main/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/node.h b/scene/main/node.h index 6b937244780..d347bda5529 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -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() || !data.inside_tree; } else { // Thread processing. return true;