Skip to content

Commit 5b1ae25

Browse files
committed
Add comments to unsafe functions
1 parent 0701b46 commit 5b1ae25

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/graph_engine.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,13 +950,15 @@ aliases(backend, fform) = error("Backend $backend must implement a method for `a
950950
aliases(model::Model, fform::F) where {F} = aliases(getbackend(model), fform)
951951

952952
function add_vertex!(model::Model, label, data)
953+
# This is an unsafe procedure that implements behaviour from `MetaGraphsNext`.
953954
code = nv(model) + 1
954955
model.graph.vertex_labels[code] = label
955956
model.graph.vertex_properties[label] = (code, data)
956957
Graphs.add_vertex!(model.graph.graph)
957958
end
958959

959960
function add_edge!(model::Model, src, dst, data)
961+
# This is an unsafe procedure that implements behaviour from `MetaGraphsNext`.
960962
code_src, code_dst = MetaGraphsNext.code_for(model.graph, src), MetaGraphsNext.code_for(model.graph, dst)
961963
model.graph.edge_data[(src, dst)] = data
962964
return Graphs.add_edge!(model.graph.graph, code_src, code_dst)

0 commit comments

Comments
 (0)