瀏覽代碼

Decorate rare !data.inside_tree condition with unlikely

CrazyRoka 1 年之前
父節點
當前提交
6c86268fdd
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/main/node.h

+ 1 - 1
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 is_current_thread_safe_for_nodes() || !data.inside_tree;
+			return is_current_thread_safe_for_nodes() || unlikely(!data.inside_tree);
 		} else {
 			// Thread processing.
 			return true;