nicolasstucki/scala-rrb-vector

prepend can create thin tree

Opened this issue · 0 comments

For the record, there is a problem in how prependFrontNewBlock determines the insertion depth.
The search for the insertion point starts with focusDepth.
However, there can be trees for which the insertion point should be lower, specifically a tree created by prepend that has a skinny leading edge.
The resulting tree behaves correctly, except that it is less dense than it should be.
The effect is that additional expansion of that tree will fail before the full maximum tree size is reached.