summaryrefslogtreecommitdiff
path: root/graph/src/adlist.rs
diff options
context:
space:
mode:
Diffstat (limited to 'graph/src/adlist.rs')
-rw-r--r--graph/src/adlist.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/graph/src/adlist.rs b/graph/src/adlist.rs
index 6c1dcd0..ba9afb8 100644
--- a/graph/src/adlist.rs
+++ b/graph/src/adlist.rs
@@ -155,6 +155,12 @@ impl Builder for ALGBuilder {
self.nodes.len() - 1
}
+ #[inline]
+ fn add_vertices(&mut self, n: usize) {
+ self.nodes
+ .extend(std::iter::repeat_with(ALNode::default).take(n));
+ }
+
fn add_edge(&mut self, source: usize, target: usize, _label: Self::Label) -> Result<(), Error> {
let nodes_len = self.nodes.len();