protected void setToRootNodeNewID ( GrowQueue_I32 regionMemberCount ) { tmpMemberCount . reset ( ) ; for ( int i = 0 ; i < mergeList . size ; i ++ ) { int p = mergeList . data [ i ] ; if ( p == i ) { mergeList . data [ i ] = rootID . data [ i ] ; tmpMemberCount . add ( regionMemberCount . data [ i ] ) ; } else { mergeList . data [ i ] = rootID . data [ mergeList . data [ i ] ] ; } } regionMemberCount . reset ( ) ; regionMemberCount . addAll ( tmpMemberCount ) ; }
Does much of the work needed to remove the redundant segments that are being merged into their root node . The list of member count is updated . mergeList is updated with the new segment IDs .