From ecbd44c5bc7514fd593916b5843fe1cc95084547 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 24 Sep 2025 00:53:07 +0800 Subject: improve has_edge --- xmake/core/base/graph.lua | 9 ++------- 1 file 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 -- cgit v1.3.1