Ensure FoldMap always contains at least one transform
Previously, when splicing an edit that deleted all transforms, we would leave the `FoldMap` empty, thus violating a bunch of downstream invariants and e.g. causing the `BufferRows` iterator to not return any buffer row. This commit ensures we always have at least one transform (an isomorphic one, specifically) and adds additional test coverage for the `FoldMap::buffer_rows` method by adding it to the randomized tests.
This commit is contained in:
@@ -102,7 +102,6 @@ impl<T: Item> SumTree<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn is_empty(&self) -> bool {
|
||||
match self.0.as_ref() {
|
||||
Node::Internal { .. } => false,
|
||||
|
||||
Reference in New Issue
Block a user