diff --git a/DataStructures/NodeBasedGraph.h b/DataStructures/NodeBasedGraph.h index 393add55b..63472b3f2 100644 --- a/DataStructures/NodeBasedGraph.h +++ b/DataStructures/NodeBasedGraph.h @@ -47,16 +47,14 @@ typedef DynamicGraph NodeBasedDynamicGraph; inline std::shared_ptr NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector &input_edge_list) { - typedef NodeBasedDynamicGraph::InputEdge DynInputEdge; - std::sort(input_edge_list.begin(), input_edge_list.end()); // TODO: remove duplicate edges - DeallocatingVector edges_list; - DynInputEdge edge; + DeallocatingVector edges_list; + NodeBasedDynamicGraph::InputEdge edge; for (const ImportEdge &import_edge : input_edge_list) { - + // TODO: give ImportEdge a proper c'tor to use emplace_back's below if (!import_edge.isForward()) { edge.source = import_edge.target(); @@ -100,11 +98,10 @@ NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector(number_of_nodes, edges_list); - // FIXME probably unneeded since this is the end of scope - DeallocatingVector().swap(edges_list); + edges_list.clear(); BOOST_ASSERT(0 == edges_list.size()); return graph; } -#endif +#endif // __NODE_BASED_GRAPH_H__