pub fn optimize_segments(segments: &[Segment], version: Version) -> Vec<Segment>Expand description
Computes the minimum-size merge plan for parser segments.
Segment boundaries are preserved; adjacent segments may be merged into the smallest common data mode that can encode the merged range.
Large inputs use an exact linear-time dynamic program with a fixed number of candidate buckets. Small inputs and exceptional coordinate ranges use the quadratic reference algorithm.