You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The existing implementation of `RangeSet.formUnion` performs a naive
insertion of each range of one range set into the other. This
requires shuffling the array of ranges down with each insertion, which
can have quadratic performance.
This change uses the known invariants of the ranges array to instead
perform the merge in linear time. Each range in the resulting array
is determined by finding the next lowest bound between the two range
sets, and then searching for the first upper bound that isn't included
in the merged range set contents.
rdar://129296438
0 commit comments