MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / DeleteEdge

Method DeleteEdge

include/util/dynamic_graph.hpp:328–339  ·  view source on GitHub ↗

removes an edge. Invalidates edge iterators for the source node

Source from the content-addressed store, hash-verified

326
327 // removes an edge. Invalidates edge iterators for the source node
328 void DeleteEdge(const NodeIterator source, const EdgeIterator e)
329 {
330 Node &node = node_array[source];
331 --number_of_edges;
332 --node.edges;
333 BOOST_ASSERT(std::numeric_limits<unsigned>::max() != node.edges);
334 const unsigned last = node.first_edge + node.edges;
335 BOOST_ASSERT(std::numeric_limits<unsigned>::max() != last);
336 // swap with last edge
337 edge_list[e] = edge_list[last];
338 makeDummy(last);
339 }
340
341 // removes all edges (source,target)
342 int32_t DeleteEdgesTo(const NodeIterator source, const NodeIterator target)

Callers 1

CompressMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected