void removeDuplicateChunkReferences(){
  HashSet<Integer> chunks=New.hashSet();
  chunks.add(DataUtils.getPageChunkId(pos));
  for (int i=0; i < children.length; i++) {
    long p=children[i];
    int chunkId=DataUtils.getPageChunkId(p);
    boolean wasNew=chunks.add(chunkId);
    if (DataUtils.getPageType(p) == DataUtils.PAGE_TYPE_NODE) {
      continue;
    }
    if (wasNew) {
      continue;
    }
    removeChild(i--);
  }
}

void removeDuplicateChunkReferences ( ) { HashSet < Integer > chunks = New . hashSet ( ) ; chunks . add ( DataUtils . getPageChunkId ( pos ) ) ; for ( int i = 0 ; i < children . length ; i ++ ) { long p = children [ i ] ; int chunkId = DataUtils . getPageChunkId ( p ) ; boolean wasNew = chunks . add ( chunkId ) ; if ( DataUtils . getPageType ( p ) == DataUtils . PAGE_TYPE_NODE ) { continue ; } if ( wasNew ) { continue ; } removeChild ( i -- ) ; } }
only keep one reference to the same chunk . only leaf references are removed ( references to inner nodes are not removed , as they could indirectly point to other chunks ) .
