MCPcopy Create free account
hub / github.com/F-Stack/f-stack / graph_assign_indices

Function graph_assign_indices

freebsd/kern/kern_lockf.c:2210–2229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2208}
2209
2210static int
2211graph_assign_indices(struct owner_graph *g, int *indices, int nextunused,
2212 struct owner_vertex_list *set)
2213{
2214 struct owner_vertex *v, *vlowest;
2215
2216 while (!TAILQ_EMPTY(set)) {
2217 vlowest = NULL;
2218 TAILQ_FOREACH(v, set, v_link) {
2219 if (!vlowest || v->v_order < vlowest->v_order)
2220 vlowest = v;
2221 }
2222 TAILQ_REMOVE(set, vlowest, v_link);
2223 vlowest->v_order = indices[nextunused];
2224 g->g_vertices[vlowest->v_order] = vlowest;
2225 nextunused++;
2226 }
2227
2228 return (nextunused);
2229}
2230
2231static int
2232graph_add_edge(struct owner_graph *g, struct owner_vertex *x,

Callers 1

graph_add_edgeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected