mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
8425e278c5
These support the relatively common use case of removing all segments in a given range (unconditionally) but doing something with them before they're removed. This is always more compact, and may be slightly faster in some cases (every replaced loop calls Isolate per iteration, while RemoveRangeWith avoids redundant split checks between segments), at the cost of a direct function call. Also slightly optimize Set.LowerBoundSegmentSplitBefore() and Set.UpperBoundSegmentSplitAfter() by inlining LowerBoundSegment and UpperBoundSegment respectively; in the cases where Find() returns a GapIterator, the segment that is returned doesn't need to be split since it doesn't contain min/max respectively. PiperOrigin-RevId: 675824581