summaryrefslogtreecommitdiff
path: root/xmake/core/base/graph.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-03-21 23:12:16 +0800
committerruki <[email protected]>2025-04-08 15:31:54 +0800
commit093894844d4d7e7e58a7a78d36f04cf59b95ff31 (patch)
treee104010f2c4fabbc196ff40f7cc56f9a0f3dcaa9 /xmake/core/base/graph.lua
parent43ea0c1fb1d9954e065f3dfdb7bd93493d5d9e38 (diff)
improve tests
Diffstat (limited to 'xmake/core/base/graph.lua')
-rw-r--r--xmake/core/base/graph.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/xmake/core/base/graph.lua b/xmake/core/base/graph.lua
index 496bffeba..31e7038d1 100644
--- a/xmake/core/base/graph.lua
+++ b/xmake/core/base/graph.lua
@@ -165,6 +165,7 @@ end
-- local batch4, has_cycle = g:partial_topo_sort_next(1) -- returns {} (empty, all done)
--
function graph:partial_topo_sort_next(limit)
+ limit = limit or math.huge
if not self:is_directed() then
return {}, false
end
@@ -173,8 +174,6 @@ function graph:partial_topo_sort_next(limit)
self:partial_topo_sort_reset()
end
- limit = limit or math.huge
-
-- check if we already detected a cycle
if self._partial_topo_has_cycle then
return {}, true