mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
perf: little adjustments on queue_children_for_update
This commit is contained in:
parent
37c2dd9a5b
commit
da154877da
1 changed files with 13 additions and 6 deletions
|
|
@ -207,13 +207,20 @@ local function queue_children_for_update<T>(node: SourceNode<T>)
|
||||||
local i = update_queue.n
|
local i = update_queue.n
|
||||||
local j = 1
|
local j = 1
|
||||||
|
|
||||||
while node[j] do
|
repeat
|
||||||
if node[j].last_eval_update_id == update_id then j += 1; continue end
|
local child = node[j]
|
||||||
i += 1
|
if not child then break end
|
||||||
node[j].higher_parent_update_id = math.max(update_id, node[j].higher_parent_update_id)
|
|
||||||
update_queue[i] = node[j]
|
if child.last_eval_update_id == update_id then j += 1; continue end
|
||||||
unparent(node[j])
|
if update_id > child.higher_parent_update_id then
|
||||||
|
child.higher_parent_update_id = update_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
i += 1
|
||||||
|
update_queue[i] = child
|
||||||
|
unparent(child)
|
||||||
|
until false
|
||||||
|
|
||||||
update_queue.n = i
|
update_queue.n = i
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue