From 5eb8b3db0d4516bf8ed7b4bca25bac592e52c460 Mon Sep 17 00:00:00 2001 From: ernisto Date: Sat, 15 Mar 2025 11:48:10 -0300 Subject: [PATCH] refactor: reuse `flush_update_queue` on `update_descendants` --- src/graph.luau | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/graph.luau b/src/graph.luau index d39c446..f01db1f 100644 --- a/src/graph.luau +++ b/src/graph.luau @@ -251,22 +251,7 @@ local function update_descendants(root: SourceNode, is_root_update: boolea queue_children_for_update(root) if flags.batch then return end - - local i = n0 + 1 - while i <= update_queue.n do - local node = update_queue[i] - --assert(node.effect) - - -- check if node is still owned in case destroyed after queued - if node.owner and evaluate_node(node) then - queue_children_for_update(node) - end - - update_queue[i] = false :: any -- false instead of nil to avoid sparse - i += 1 - end - - update_queue.n = n0 + flush_update_queue(n0) end local function push_child_to_scope(node: SourceNode)