diff options
| author | ruki <[email protected]> | 2025-09-24 00:53:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-24 00:53:07 +0800 |
| commit | ecbd44c5bc7514fd593916b5843fe1cc95084547 (patch) | |
| tree | 8ac5981493f9e73cdda923baf202390a790f1bac /xmake/core/base/graph.lua | |
| parent | b73b791399b272c7a3d811df71cf6af3df50a4e0 (diff) | |
improve has_edge
Diffstat (limited to 'xmake/core/base/graph.lua')
| -rw-r--r-- | xmake/core/base/graph.lua | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/xmake/core/base/graph.lua b/xmake/core/base/graph.lua index 29109a6bc..64dfa3b31 100644 --- a/xmake/core/base/graph.lua +++ b/xmake/core/base/graph.lua @@ -403,16 +403,11 @@ function graph:has_edge(from, to) local edges_map = self._edges_map local from_map = edges_map[from] if self:is_directed() then - if from_map and from_map[to] then - return true - end + return from_map and from_map[to] else local to_map = edges_map[to] - if from_map and to_map and from_map[to] and to_map[from] then - return true - end + return from_map and to_map and from_map[to] and to_map[from] end - return false end -- clone graph |
