Skip to content

Commit

Permalink
chore: add is_empty mehtod for IntervalsTree
Browse files Browse the repository at this point in the history
  • Loading branch information
ecol-master committed Jan 20, 2025
1 parent e831d6a commit 7113011
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/numerated/src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ impl<T: Copy> IntervalsTree<T> {
pub fn intervals_amount(&self) -> usize {
self.inner.len()
}

/// Checks if the tree is empty.
/// Returns `true` if the tree contains no elements.
pub fn is_empty(&self) -> bool {
self.inner.is_empty()
}
}

impl<T: Copy + Ord> IntervalsTree<T> {
Expand Down

0 comments on commit 7113011

Please sign in to comment.