Skip to content

Commit eb7b67e

Browse files
committed
Change internal handling of add_vertex! checks
Related issue: #41
1 parent fe2a5bb commit eb7b67e

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 != nv(meta_graph.graph)
129131
if added
130132
code = nv(meta_graph)
131133
meta_graph.vertex_labels[code] = label

0 commit comments

Comments
 (0)