Skip to content

Commit 23faa84

Browse files
committed
redirect has_edge
1 parent cc35723 commit 23faa84

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/staticgraph.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,6 @@ badj(g::StaticGraph, s) = fadj(g, s)
4444

4545
ne(g::StaticGraph{T, U}) where T where U = U(length(g.f_vec) ÷ 2)
4646

47-
function has_edge(g::StaticGraph, e::StaticGraphEdge)
48-
u, v = Tuple(e)
49-
(u > nv(g) || v > nv(g)) && return false
50-
if degree(g, u) > degree(g, v)
51-
u, v = v, u
52-
end
53-
return insorted(v, fadj(g, u))
54-
end
55-
5647
function in(e::StaticGraphEdge, g::StaticGraph)
5748
u, v = Tuple(e)
5849
(u > nv(g) || v > nv(g)) && return false
@@ -62,6 +53,8 @@ function in(e::StaticGraphEdge, g::StaticGraph)
6253
return insorted(v, fadj(g, u))
6354
end
6455

56+
has_edge(g::StaticGraph, e::StaticGraphEdge) = in(e, g)
57+
6558
==(g::StaticGraph, h::StaticGraph) = g.f_vec == h.f_vec && g.f_ind == h.f_ind
6659

6760
degree(g::StaticGraph{T, U}, v::Integer) where T where U = T(length(_fvrange(g, v)))

0 commit comments

Comments
 (0)