protected int GetSegmentLength(Segment segment) { if (segment == null) return 0; return segment.end - segment.start; }