typegraph/scripts/graph/removeLink.gml

22 lines
464 B
Plaintext

///removeLink(from, to)
/**
* removeLink :: TypeConLink -> TypeConLink -> ()
*
* Removes an edge from one type con to another.
*
* @param from the source of the edge
* @param to the target of the edge
*/
var from = argument0;
var to = argument1;
assertInstanceof(from, TypeConLink);
assertInstanceof(to, TypeConLink);
ds_list_delete(from.to, ds_list_find_index(from.to, to));
if (ds_list_find_index(from.to, to) == -1)
ds_set_delete(to.from, from);