Refactor ElementMap, removing its copy-on-write feature

This commit is contained in:
2026-10-11 22:24:00 +02:00
parent 4e20c49486
commit 3d7dda6f7b
9 changed files with 281 additions and 113 deletions
-2
View File
@@ -262,7 +262,6 @@ impl GraphTopology for Graph {
self.vertices.len()
}
// TODO: Create with capacity 0, maybe offer pre-allocated alternative?
fn vertex_map<T: Clone>(&self, default: T) -> ElementMap<Self::Vertex, T> {
ElementMap::new(default, |v| v.arr_idx(), self.vertex_capacity())
}
@@ -271,7 +270,6 @@ impl GraphTopology for Graph {
self.incidences.len() / 2
}
// TODO: Create with capacity 0, maybe offer pre-allocated alternative?
fn edge_map<T: Clone>(&self, default: T) -> ElementMap<Self::Edge, T> {
ElementMap::new(default, |e| e.arr_idx() / 2, self.edge_capacity())
}