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
13: Alternative set of contains function r=CAD97 a=matklad
Motivation:
TextRange is a set, it contains elements (TextSize). For this reason,
for range-range op we use a more verbose `contains_range` name.
In stdlib, there's `HashSet::is_subset`. We used a similar design with
`is_subrage` before, but it was very confusing in practice -- you'll
have to lookup docs for which of lhs and rhs is sub and super set.
Additionally, exclusive semantics is a clear default with better
properties (if you have a partitioning of a range into subranges, only
one of the parts contains any given offset), so it make sense to call
it `contains` and reserve `contains_inclusive` for another op.
Co-authored-by: Aleksey Kladov <[email protected]>
0 commit comments