[Stdlib] Rationalize the SubSequence type of a filtered Collection. #8898
+32
−103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Address ABI FIXMEs #28, #80, #81 by making the
SubSequence
of a filteredcollection into be a filtered collection of the base's
SubSequence rather than a slice of this filtered collection, e.g.,
replace
Slice<LazyFilterCollection<Array<T>>>
withLazyFilterCollection<ArraySlice<T>>
, which allows slicingoptimizations of the base type to kick in.
While here, eliminate the vestigial type
LazyFilterIndex
, which wasnecessary pre-Swift-3 to allow the index to move. Swift 3's indexing
model means that the movement of indices is on the collection itself,
so we no longer need
LazyFilterIndex
: instead, theIndex
type ofthe lazy filtered collection is simply the
Index
type of the basecollection, which is a nice convenience: it means you can take indices
from a lazy wrapper around a given collection C and use them with the
collection C (and, with care, vice-versa) without jumping through
extra hoops.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.