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:
2026-07-24 10:09:37 +02:00
parent 3fa4b66981
commit 9f76ce4ce3
+2 -2
View File
@@ -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> {