Flush() rebuilds the serializable form of the node and, setting the Values array for leaves and Links for non-leaves, in the process it sets up the bitmap again for each set element. On the non-leaf nodes we get a fresh bitmap to work with but the same is not done on leaf nodes.
I'm not convinced this is strictly necessary since setBit() and clearBit() are called on mutations elsewhere, but as long as we're doing a fresh rebuild and it's being done for non-leaf nodes, this should be done here to be absolutely sure, otherwise the n.setBit(i) isn't necessary either.
Flush()
rebuilds the serializable form of the node and, setting theValues
array for leaves andLinks
for non-leaves, in the process it sets up the bitmap again for each set element. On the non-leaf nodes we get a fresh bitmap to work with but the same is not done on leaf nodes.I'm not convinced this is strictly necessary since
setBit()
andclearBit()
are called on mutations elsewhere, but as long as we're doing a fresh rebuild and it's being done for non-leaf nodes, this should be done here to be absolutely sure, otherwise then.setBit(i)
isn't necessary either.