mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* [stdlib] Slice: customize withContiguous[Mutable]StorageIfAvailable We can easily make an UnsafeBufferPointer that slices another UnsafeBufferPointer, so let’s allow Slice to vend a slice of the base collection’s contiguous storage, if it provides access to one. We need to do some index distance calculations to implement this, but those will be constant-time in the usual case where the base collection is a RAC. https://bugs.swift.org/browse/SR-11957 rdar://58090587 * [test] UnsafeBufferPointer: fix some warnings * [stdlib] Slice: don’t calculate index distances unless the base provides contiguous mutable storage
4.0 KiB
4.0 KiB