mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
Use the defines from traits directly
Package traits already pass defines with their trait name when building. Instead of adding our own conditional defines based on the traits we can use the trait provided defines directly. I observed that various tooling behaves better with the trait provided defines.
This commit is contained in:
1 parent
12eb78f778
commit
3c373b900c
208 files changed
+359
-369
No files matched your search
@@ -92,7 +92,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
_storage.append(moving: items)
|
||||
}
|
||||
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if UnstableContainersPreview
|
||||
/// Moves the elements of a input span to the end of this array, leaving the
|
||||
/// span empty.
|
||||
///
|
||||
@@ -157,7 +157,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if UnstableContainersPreview
|
||||
/// Appends the elements of a given container to the end of this array by
|
||||
/// consuming the source container.
|
||||
///
|
||||
@@ -179,7 +179,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Appends at most `newItemCount` items generated by a producer to the end of
|
||||
/// this array.
|
||||
///
|
||||
@@ -214,7 +214,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Appends all the items generated by a producer to the end of this deque.
|
||||
///
|
||||
/// If the deque doesn't have sufficient capacity to accommodate all the
|
||||
@@ -307,7 +307,7 @@ extension UniqueArray {
|
||||
_storage.append(copying: newElements)
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@inlinable
|
||||
internal mutating func _append<
|
||||
Source: BorrowingSequence_<Element> & ~Copyable & ~Escapable
|
||||
@@ -326,7 +326,7 @@ extension UniqueArray {
|
||||
// FIXME: Add _append(copyingContainer:), forwarding to the same method on RigidArray
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Copies the elements of a borrowing sequence to the end of this array.
|
||||
///
|
||||
/// If the array does not have sufficient capacity to hold enough elements,
|
||||
@@ -382,7 +382,7 @@ extension UniqueArray {
|
||||
}
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Copies the elements of a container to the end of this array.
|
||||
///
|
||||
/// If the array does not have sufficient capacity to hold enough elements,
|
||||
|
||||
@@ -18,7 +18,7 @@ import ContainersPreview
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
@_lifetime(&self)
|
||||
@@ -116,7 +116,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.3) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.3) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
public typealias SubrangeConsumer = RigidArray<Element>.SubrangeConsumer
|
||||
|
||||
@@ -18,7 +18,7 @@ import ContainersPreview
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray: BorrowingSequence_ where Element: ~Copyable {
|
||||
public typealias BorrowingIterator_ = RigidArray<Element>.BorrowingIterator_
|
||||
@@ -34,7 +34,7 @@ extension UniqueArray: BorrowingSequence_ where Element: ~Copyable {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray: Container where Element: ~Copyable {}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
}
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray: Equatable where Element: Equatable & ~Copyable {
|
||||
@inlinable
|
||||
|
||||
@@ -17,7 +17,7 @@ import InternalCollectionsUtilities
|
||||
import ContainersPreview
|
||||
#endif
|
||||
|
||||
#if compiler(>=6.2) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.2) && UnstableContainersPreview
|
||||
|
||||
#if false // TODO
|
||||
extension UniqueArray /*where Element: Copyable*/ {
|
||||
|
||||
@@ -85,7 +85,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray /*where Element: Copyable*/ {
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Creates a new array with the specified initial capacity, holding a copy
|
||||
/// of the contents of a given borrowing sequence.
|
||||
///
|
||||
@@ -122,7 +122,7 @@ extension UniqueArray /*where Element: Copyable*/ {
|
||||
self.append(copying: contents)
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Creates a new array with the specified initial capacity, holding a copy
|
||||
/// of the contents of a given container.
|
||||
///
|
||||
|
||||
@@ -121,7 +121,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
_storage.insert(moving: items, at: index)
|
||||
}
|
||||
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if UnstableContainersPreview
|
||||
/// Moves the elements of an input span into this array,
|
||||
/// starting at the specified position, and leaving the span empty.
|
||||
///
|
||||
@@ -201,7 +201,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if UnstableContainersPreview
|
||||
/// Inserts the elements of a given array into the given position in this
|
||||
/// array by consuming the source container.
|
||||
///
|
||||
@@ -229,7 +229,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Inserts at most `newItemCount` items generated by a producer into this
|
||||
/// array, starting at the given index.
|
||||
///
|
||||
@@ -368,7 +368,7 @@ extension UniqueArray {
|
||||
_storage.insert(copying: newElements, at: index)
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Copies the elements of a container into this array at the specified
|
||||
/// position.
|
||||
///
|
||||
@@ -435,7 +435,7 @@ extension UniqueArray {
|
||||
at: index, copying: newElements, newCount: newCount)
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Copies the elements of a container into this array at the specified
|
||||
/// position.
|
||||
///
|
||||
|
||||
@@ -80,7 +80,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if UnstableContainersPreview
|
||||
/// Replaces the specified range of elements by a given count of new items,
|
||||
/// using callbacks to consume old items, and to then insert new ones.
|
||||
///
|
||||
@@ -189,7 +189,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
_storage.replace(removing: subrange, moving: newElements)
|
||||
}
|
||||
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if UnstableContainersPreview
|
||||
/// Replaces the specified range of elements by moving the contents of an
|
||||
/// input span into their place. On return, the span is left empty.
|
||||
///
|
||||
@@ -345,7 +345,7 @@ extension UniqueArray where Element: ~Copyable {
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Replaces the specified range of elements by at most `maximumCount` items
|
||||
/// generated by a producer.
|
||||
///
|
||||
@@ -522,7 +522,7 @@ extension UniqueArray {
|
||||
_storage.replace(removing: subrange, copying: newElements)
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Replaces the specified subrange of elements by copying the elements of
|
||||
/// the given container.
|
||||
///
|
||||
@@ -612,7 +612,7 @@ extension UniqueArray {
|
||||
newCount: c)
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
#if compiler(>=6.4) && UnstableContainersPreview
|
||||
/// Replaces the specified subrange of elements by copying the elements of
|
||||
/// the given container.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user