Skip to content

Commit cbbdb25

Browse files
authored
Merge pull request #47 from filchristou/addvertintern
Change internal handling of add_vertex! checks
2 parents fe2a5bb + 2fa5b52 commit cbbdb25

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/graphs.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ function Graphs.add_vertex!(meta_graph::MetaGraph, label, data)
125125
if haskey(meta_graph, label)
126126
return false
127127
end
128-
added = add_vertex!(meta_graph.graph)
128+
nvnum = nv(meta_graph.graph)
129+
add_vertex!(meta_graph.graph)
130+
added = nvnum + 1 == nv(meta_graph.graph)
129131
if added
130132
code = nv(meta_graph)
131133
meta_graph.vertex_labels[code] = label

0 commit comments

Comments
 (0)