code: private void compactEntries(Segment segment, Segment compactSegment) {
      for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) {
        checkEntry(i, segment, compactSegment);
      }
    }
docs: Compacts entries from the given segment, rewriting them to the compact segment.
  
  @param segment The segment to compact.
  @param compactSegment The compact segment.