mirror of
https://github.com/apple/swift-collections
synced 2026-11-27 04:54:21 +00:00
Drop support for Swift 6.0 and 6.1
This allows the use of Span types without `#if compiler` guards.
This commit is contained in:
145 files changed
+342
-1047
No files matched your search
@@ -30,7 +30,7 @@ struct ArrayLayout {
|
||||
self.capacity = capacity
|
||||
self.count = count
|
||||
}
|
||||
|
||||
|
||||
var isFull: Bool { count == capacity }
|
||||
var isEmpty: Bool { count == 0 }
|
||||
var freeCapacity: Int { capacity - count }
|
||||
@@ -74,7 +74,6 @@ func withSomeArrayLayouts<E: Error>(
|
||||
}
|
||||
}
|
||||
|
||||
#if compiler(>=6.2)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
init(layout: ArrayLayout, using generator: (Int) -> Element) {
|
||||
self.init(capacity: layout.capacity) { span in
|
||||
@@ -98,7 +97,7 @@ extension LifetimeTracker {
|
||||
) -> RigidArray<LifetimeTracked<Element>> {
|
||||
RigidArray(layout: layout, using: { self.instance(for: generator($0)) })
|
||||
}
|
||||
|
||||
|
||||
func uniqueArray<Element>(
|
||||
layout: ArrayLayout,
|
||||
using generator: (Int) -> Element = { $0 }
|
||||
@@ -108,7 +107,7 @@ extension LifetimeTracker {
|
||||
}
|
||||
return UniqueArray(consuming: contents)
|
||||
}
|
||||
|
||||
|
||||
#if UnstableContainersPreview
|
||||
func withInputSpan<Element>(
|
||||
layout: ArrayLayout,
|
||||
@@ -128,7 +127,7 @@ extension LifetimeTracker {
|
||||
buffer.deallocate()
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
func withOutputSpan<Element>(
|
||||
layout: ArrayLayout,
|
||||
using generator: (Int) -> Element,
|
||||
@@ -140,4 +139,3 @@ extension LifetimeTracker {
|
||||
contents.edit(body)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in new issue
Block a user