summaryrefslogtreecommitdiff
path: root/xmake/core/base/graph.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-29 21:02:07 +0800
committerruki <[email protected]>2023-09-29 21:02:07 +0800
commitc7486bd09c28892efa166119b94e87d005659b32 (patch)
tree7a636c478d9fc6ccadb0273d322a47f45077de4b /xmake/core/base/graph.lua
parent270341b90e881c36467f2e03a01909e2d509331f (diff)
sort links using graph
Diffstat (limited to 'xmake/core/base/graph.lua')
-rw-r--r--xmake/core/base/graph.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/core/base/graph.lua b/xmake/core/base/graph.lua
index 86746dfa9..875bceb45 100644
--- a/xmake/core/base/graph.lua
+++ b/xmake/core/base/graph.lua
@@ -58,6 +58,11 @@ function graph:clear()
self._adjacent_edges = {}
end
+-- is empty?
+function graph:empty()
+ return #self:vertices() == 0
+end
+
-- is directed?
function graph:is_directed()
return self._directed