Skip to content

Commit 6fdaafa

Browse files
committed
feat: add Graph::len()
Get an idea about he size of the graph.
1 parent 60f0e00 commit 6fdaafa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gix-revwalk/src/graph/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ impl<'find, 'cache, T: Default> Graph<'find, 'cache, T> {
7575

7676
/// Access and mutation
7777
impl<'find, 'cache, T> Graph<'find, 'cache, T> {
78+
/// Returns the amount of entries in the graph.
79+
pub fn len(&self) -> usize {
80+
self.map.len()
81+
}
7882
/// Returns true if `id` has data associated with it, meaning that we processed it already.
7983
pub fn contains(&self, id: &gix_hash::oid) -> bool {
8084
self.map.contains_key(id.as_ref())

0 commit comments

Comments
 (0)