summaryrefslogtreecommitdiff
path: root/xmake/modules/async/jobgraph.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-24 00:52:38 +0800
committerruki <[email protected]>2025-09-24 00:52:38 +0800
commitb73b791399b272c7a3d811df71cf6af3df50a4e0 (patch)
tree9e447feec43d372abd9bf823a3e24e6615534630 /xmake/modules/async/jobgraph.lua
parentbf906566d8a9f69f09a6c0f20a9da30e3555d338 (diff)
improve jobgraph
Diffstat (limited to 'xmake/modules/async/jobgraph.lua')
-rw-r--r--xmake/modules/async/jobgraph.lua20
1 files changed, 5 insertions, 15 deletions
diff --git a/xmake/modules/async/jobgraph.lua b/xmake/modules/async/jobgraph.lua
index 19d9f5e5a..5ad5d3bac 100644
--- a/xmake/modules/async/jobgraph.lua
+++ b/xmake/modules/async/jobgraph.lua
@@ -167,31 +167,21 @@ function jobgraph:add_orders(...)
-- we use a bridge job as a node to bridge the two groups.
local bridge = {from_group = prev_name, to_group = name}
for _, job in ipairs(prev) do
- if not dag:has_edge(job, bridge) then
- dag:add_edge(job, bridge)
- end
+ dag:add_edge(job, bridge)
end
for _, job in ipairs(curr) do
- if not dag:has_edge(bridge, job) then
- dag:add_edge(bridge, job)
- end
+ dag:add_edge(bridge, job)
end
elseif curr_is_group then
for _, job in ipairs(curr) do
- if not dag:has_edge(prev, job) then
- dag:add_edge(prev, job)
- end
+ dag:add_edge(prev, job)
end
elseif prev_is_group then
for _, job in ipairs(prev) do
- if not dag:has_edge(job, curr) then
- dag:add_edge(job, curr)
- end
+ dag:add_edge(job, curr)
end
else
- if not dag:has_edge(prev, curr) then
- dag:add_edge(prev, curr)
- end
+ dag:add_edge(prev, curr)
end
end
prev = curr