mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rather than using the default slice type when slicing the collection produced by a lazy map or filter, slice the base collection and form a new lazy map/filter collection from it. This allows any optimizations provided by the collection SubSequence type to kick in, as well as ensuring that slicing a lazy collection provides the same type as producing a lazy collection of a slice. This is technically source-breaking, because someone could have spelled out the types of slicing a lazy filter or map… but it seems unlikely to matter in practice and the benefits could be significant. Fixes ABI FIXME’s #28 and #46.
46 KiB
46 KiB