I haven't found a way to check if one leaf is ahead of another.
So i took an advantage of the fact that we are advancing leaf iterators one at a time.
I.e. before advancing right/left leaf iterator we check if they are pointing to the same node and if so there is no elements left.
Continuation of #118.
Description for the edge case is in the comment.
I haven't found a way to check if one leaf is ahead of another. So i took an advantage of the fact that we are advancing leaf iterators one at a time. I.e. before advancing right/left leaf iterator we check if they are pointing to the same node and if so there is no elements left.