Skip to content

Commit 5303cb4

Browse files
committed
Checked for uniqueness of the label
1 parent a05c081 commit 5303cb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/graphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ Add a vertex to MetaGraph `g` with label `label` having value `val`.
5151
Return true if the vertex has been added, false incase the label already exists or edge was not added.
5252
"""
5353
function add_vertex!(g::MetaGraph, label, val)
54-
added = add_vertex!(g.graph)
5554
if g.haskey(label)
5655
return false
56+
added = add_vertex!(g.graph)
5757
if added
5858
v = nv(g)
5959
g.vprops[label] = (v, val)

0 commit comments

Comments
 (0)