Fix vertex_capacity and edge_capacity in AppendGraph
Fix AppendGraph::vertex_capacity and AppendGraph::edge_capacity to use the actual capacity of the underlying Vecs.
This commit is contained in:
@@ -93,7 +93,7 @@ impl GraphTopology for AppendGraph {
|
||||
}
|
||||
|
||||
fn vertex_capacity(&self) -> usize {
|
||||
self.vertices.len()
|
||||
self.vertices.capacity()
|
||||
}
|
||||
|
||||
fn vertex_map<T: Clone>(&self, default: T) -> VertexMap<Self::Vertex, T> {
|
||||
@@ -105,7 +105,7 @@ impl GraphTopology for AppendGraph {
|
||||
}
|
||||
|
||||
fn edge_capacity(&self) -> usize {
|
||||
self.incidences.len() / 2
|
||||
self.incidences.capacity() / 2
|
||||
}
|
||||
|
||||
fn edge_map<T: Clone>(&self, default: T) -> EdgeMap<Self::Edge, T> {
|
||||
|
||||
Reference in New Issue
Block a user