From a8dad62bc9c76f1f455a372c91759e7bb1e92e63 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Mon, 10 Apr 2023 18:33:52 -0700 Subject: [PATCH] Remove obsolete swift(>=5.5)/swift(>=5.6) checks --- Sources/BitCollections/BitArray/BitArray.swift | 4 +--- .../BitSet/BitSet+BidirectionalCollection.swift | 4 +--- Sources/BitCollections/BitSet/BitSet.Counted.swift | 4 +--- Sources/BitCollections/BitSet/BitSet.Index.swift | 4 +--- Sources/BitCollections/BitSet/BitSet.swift | 4 +--- Sources/DequeModule/Deque+Collection.swift | 4 +--- Sources/DequeModule/Deque+Sendable.swift | 4 +--- .../TreeDictionary/TreeDictionary+Codable.swift | 6 +----- .../TreeDictionary/TreeDictionary+Collection.swift | 4 +--- .../TreeDictionary/TreeDictionary+Keys.swift | 6 +----- .../TreeDictionary/TreeDictionary+Sendable.swift | 4 +--- .../TreeDictionary/TreeDictionary+Sequence.swift | 4 +--- .../TreeDictionary/TreeDictionary+Values.swift | 6 +----- .../TreeSet/TreeSet+Collection.swift | 4 +--- .../HashTreeCollections/TreeSet/TreeSet+Sendable.swift | 4 +--- .../HashTreeCollections/TreeSet/TreeSet+Sequence.swift | 4 +--- Sources/HeapModule/Heap.swift | 4 +--- .../OrderedDictionary+Elements.SubSequence.swift | 6 +----- .../OrderedDictionary/OrderedDictionary+Elements.swift | 4 +--- .../OrderedDictionary/OrderedDictionary+Sendable.swift | 4 +--- .../OrderedDictionary/OrderedDictionary+Sequence.swift | 4 +--- .../OrderedDictionary/OrderedDictionary+Values.swift | 4 +--- .../OrderedSet/OrderedSet+SubSequence.swift | 4 +--- .../OrderedSet/OrderedSet+UnorderedView.swift | 4 +--- .../OrderedSet/OrderedSet+UnstableInternals.swift | 4 +--- .../TreeDictionary Tests.swift | 10 +--------- 26 files changed, 26 insertions(+), 92 deletions(-) diff --git a/Sources/BitCollections/BitArray/BitArray.swift b/Sources/BitCollections/BitArray/BitArray.swift index 2c042359..99e26141 100644 --- a/Sources/BitCollections/BitArray/BitArray.swift +++ b/Sources/BitCollections/BitArray/BitArray.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021-2023 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -48,9 +48,7 @@ public struct BitArray { } } -#if swift(>=5.5) extension BitArray: Sendable {} -#endif extension BitArray { @inline(__always) diff --git a/Sources/BitCollections/BitSet/BitSet+BidirectionalCollection.swift b/Sources/BitCollections/BitSet/BitSet+BidirectionalCollection.swift index f910e28d..fdd13a87 100644 --- a/Sources/BitCollections/BitSet/BitSet+BidirectionalCollection.swift +++ b/Sources/BitCollections/BitSet/BitSet+BidirectionalCollection.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -88,9 +88,7 @@ extension BitSet: Sequence { } } -#if swift(>=5.5) extension BitSet.Iterator: Sendable {} -#endif extension BitSet: Collection, BidirectionalCollection { /// A Boolean value indicating whether the collection is empty. diff --git a/Sources/BitCollections/BitSet/BitSet.Counted.swift b/Sources/BitCollections/BitSet/BitSet.Counted.swift index 9acfc731..bcbbf476 100644 --- a/Sources/BitCollections/BitSet/BitSet.Counted.swift +++ b/Sources/BitCollections/BitSet/BitSet.Counted.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -28,9 +28,7 @@ extension BitSet { } } -#if swift(>=5.5) extension BitSet.Counted: Sendable {} -#endif extension BitSet.Counted { #if COLLECTIONS_INTERNAL_CHECKS diff --git a/Sources/BitCollections/BitSet/BitSet.Index.swift b/Sources/BitCollections/BitSet/BitSet.Index.swift index a0518d30..433dd37d 100644 --- a/Sources/BitCollections/BitSet/BitSet.Index.swift +++ b/Sources/BitCollections/BitSet/BitSet.Index.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -43,9 +43,7 @@ extension BitSet { } } -#if swift(>=5.5) extension BitSet.Index: Sendable {} -#endif extension BitSet.Index: CustomStringConvertible { // A textual representation of this instance. diff --git a/Sources/BitCollections/BitSet/BitSet.swift b/Sources/BitCollections/BitSet/BitSet.swift index 26cf01b0..dfb09742 100644 --- a/Sources/BitCollections/BitSet/BitSet.swift +++ b/Sources/BitCollections/BitSet/BitSet.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -33,9 +33,7 @@ public struct BitSet { } } -#if swift(>=5.5) extension BitSet: Sendable {} -#endif extension BitSet { @inline(__always) diff --git a/Sources/DequeModule/Deque+Collection.swift b/Sources/DequeModule/Deque+Collection.swift index 8212a293..6dcdc28e 100644 --- a/Sources/DequeModule/Deque+Collection.swift +++ b/Sources/DequeModule/Deque+Collection.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -164,9 +164,7 @@ extension Deque: Sequence { } } -#if swift(>=5.5) extension Deque.Iterator: Sendable where Element: Sendable {} -#endif extension Deque: RandomAccessCollection { public typealias Index = Int diff --git a/Sources/DequeModule/Deque+Sendable.swift b/Sources/DequeModule/Deque+Sendable.swift index 0ebf4bb0..df3fdd54 100644 --- a/Sources/DequeModule/Deque+Sendable.swift +++ b/Sources/DequeModule/Deque+Sendable.swift @@ -2,13 +2,11 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // //===----------------------------------------------------------------------===// -#if swift(>=5.5) extension Deque: @unchecked Sendable where Element: Sendable {} -#endif diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Codable.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Codable.swift index 7a9d4246..c929e01a 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Codable.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Codable.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -60,7 +60,6 @@ where Key: Encodable, Value: Encodable } return } -#if swift(>=5.6) if #available(macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4, *), Key.self is CodingKeyRepresentable.Type { // Since the keys are CodingKeyRepresentable, we can use the `codingKey` @@ -73,7 +72,6 @@ where Key: Encodable, Value: Encodable } return } -#endif // Keys are Encodable but not Strings or Ints, so we cannot arbitrarily // convert to keys. We can encode as an array of alternating key-value // pairs, though. @@ -133,7 +131,6 @@ where Key: Decodable, Value: Decodable return } -#if swift(>=5.6) if #available(macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4, *), let keyType = Key.self as? CodingKeyRepresentable.Type { // The keys are CodingKeyRepresentable, so we should be able to expect @@ -152,7 +149,6 @@ where Key: Decodable, Value: Decodable } return } -#endif // We should have encoded as an array of alternating key-value pairs. var container = try decoder.unkeyedContainer() diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Collection.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Collection.swift index 86089e61..a1df0ed0 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Collection.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Collection.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -38,10 +38,8 @@ extension TreeDictionary { } } -#if swift(>=5.5) extension TreeDictionary.Index: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif extension TreeDictionary.Index: Equatable { /// Returns a Boolean value indicating whether two index values are equal. diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Keys.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Keys.swift index 84fb7001..da2d3a54 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Keys.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Keys.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -38,10 +38,8 @@ extension TreeDictionary { } } -#if swift(>=5.5) extension TreeDictionary.Keys: Sendable where Key: Sendable, Value: Sendable {} -#endif extension TreeDictionary.Keys: _UniqueCollection {} @@ -114,10 +112,8 @@ extension TreeDictionary.Keys: Sequence { } } -#if swift(>=5.5) extension TreeDictionary.Keys.Iterator: Sendable where Key: Sendable, Value: Sendable {} -#endif extension TreeDictionary.Keys: Collection { public typealias Index = TreeDictionary.Index diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Sendable.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Sendable.swift index 01bdf115..f347d3c6 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Sendable.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Sendable.swift @@ -2,14 +2,12 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // //===----------------------------------------------------------------------===// -#if swift(>=5.5) extension TreeDictionary: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Sequence.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Sequence.swift index f504404c..3c86dd01 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Sequence.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Sequence.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2019 - 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2019 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -51,10 +51,8 @@ extension TreeDictionary: Sequence { } } -#if swift(>=5.5) extension TreeDictionary.Iterator: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif extension TreeDictionary.Iterator: IteratorProtocol { /// The element type of a dictionary: a tuple containing an individual diff --git a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Values.swift b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Values.swift index 7384ed79..40d4d4a1 100644 --- a/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Values.swift +++ b/Sources/HashTreeCollections/TreeDictionary/TreeDictionary+Values.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -43,10 +43,8 @@ extension TreeDictionary { } } -#if swift(>=5.5) extension TreeDictionary.Values: Sendable where Key: Sendable, Value: Sendable {} -#endif extension TreeDictionary.Values: CustomStringConvertible { // A textual representation of this instance. @@ -92,10 +90,8 @@ extension TreeDictionary.Values: Sequence { } } -#if swift(>=5.5) extension TreeDictionary.Values.Iterator: Sendable where Key: Sendable, Value: Sendable {} -#endif // Note: This cannot be a MutableCollection because its subscript setter // needs to invalidate indices. diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+Collection.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+Collection.swift index ad45426a..dde99c0c 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+Collection.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+Collection.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -38,10 +38,8 @@ extension TreeSet { } } -#if swift(>=5.5) extension TreeSet.Index: @unchecked Sendable where Element: Sendable {} -#endif extension TreeSet.Index: Equatable { /// Returns a Boolean value indicating whether two index values are equal. diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+Sendable.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+Sendable.swift index b5b758e2..e19e0a1b 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+Sendable.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+Sendable.swift @@ -2,13 +2,11 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // //===----------------------------------------------------------------------===// -#if swift(>=5.5) extension TreeSet: @unchecked Sendable where Element: Sendable {} -#endif diff --git a/Sources/HashTreeCollections/TreeSet/TreeSet+Sequence.swift b/Sources/HashTreeCollections/TreeSet/TreeSet+Sequence.swift index 00e8fe66..43d3ac4a 100644 --- a/Sources/HashTreeCollections/TreeSet/TreeSet+Sequence.swift +++ b/Sources/HashTreeCollections/TreeSet/TreeSet+Sequence.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -49,7 +49,5 @@ extension TreeSet: Sequence { } } -#if swift(>=5.5) extension TreeSet.Iterator: @unchecked Sendable where Element: Sendable {} -#endif diff --git a/Sources/HeapModule/Heap.swift b/Sources/HeapModule/Heap.swift index d63017e1..4e7e60e9 100644 --- a/Sources/HeapModule/Heap.swift +++ b/Sources/HeapModule/Heap.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -35,9 +35,7 @@ public struct Heap { } } -#if swift(>=5.5) extension Heap: Sendable where Element: Sendable {} -#endif extension Heap { /// A Boolean value indicating whether or not the heap is empty. diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift index 5f3b7b71..b6c9f16f 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -34,10 +34,8 @@ extension OrderedDictionary.Elements { } } -#if swift(>=5.5) extension OrderedDictionary.Elements.SubSequence: Sendable where Key: Sendable, Value: Sendable {} -#endif extension OrderedDictionary.Elements.SubSequence: CustomStringConvertible { // A textual representation of this instance. @@ -149,10 +147,8 @@ extension OrderedDictionary.Elements.SubSequence: Sequence { } } -#if swift(>=5.5) extension OrderedDictionary.Elements.SubSequence.Iterator: Sendable where Key: Sendable, Value: Sendable {} -#endif extension OrderedDictionary.Elements.SubSequence: RandomAccessCollection { /// The index type for an ordered dictionary: `Int`. diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift index 403d01b2..66cd9926 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -29,10 +29,8 @@ extension OrderedDictionary { } } -#if swift(>=5.5) extension OrderedDictionary.Elements: Sendable where Key: Sendable, Value: Sendable {} -#endif extension OrderedDictionary { /// A view of the contents of this dictionary as a random-access collection. diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sendable.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sendable.swift index 539a4fe1..b8ce4670 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sendable.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sendable.swift @@ -2,14 +2,12 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2022 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // //===----------------------------------------------------------------------===// -#if swift(>=5.5) extension OrderedDictionary: @unchecked Sendable where Key: Sendable, Value: Sendable {} -#endif diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sequence.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sequence.swift index 21967d9e..4d516ed5 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sequence.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sequence.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -62,7 +62,5 @@ extension OrderedDictionary: Sequence { } } -#if swift(>=5.5) extension OrderedDictionary.Iterator: Sendable where Key: Sendable, Value: Sendable {} -#endif diff --git a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift index 1bafecee..6796917f 100644 --- a/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift +++ b/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -28,10 +28,8 @@ extension OrderedDictionary { } } -#if swift(>=5.5) extension OrderedDictionary.Values: Sendable where Key: Sendable, Value: Sendable {} -#endif extension OrderedDictionary.Values: CustomStringConvertible { // A textual representation of this instance. diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift index 51079bfb..017a0d22 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -37,9 +37,7 @@ extension OrderedSet { } } -#if swift(>=5.5) extension OrderedSet.SubSequence: Sendable where Element: Sendable {} -#endif extension OrderedSet.SubSequence { @inlinable diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift index 783840f3..8efa76d0 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -66,9 +66,7 @@ extension OrderedSet { } } -#if swift(>=5.5) extension OrderedSet.UnorderedView: Sendable where Element: Sendable {} -#endif extension OrderedSet.UnorderedView: CustomStringConvertible { /// A textual representation of this instance. diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+UnstableInternals.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+UnstableInternals.swift index 3c94ed43..effc6ec0 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+UnstableInternals.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+UnstableInternals.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -47,7 +47,5 @@ extension OrderedSet { } } -#if swift(>=5.5) extension OrderedSet._UnstableInternals: Sendable where Element: Sendable {} -#endif diff --git a/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift b/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift index aae5e315..c38fcfc7 100644 --- a/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift +++ b/Tests/HashTreeCollectionsTests/TreeDictionary Tests.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift Collections open source project // -// Copyright (c) 2021 - 2022 Apple Inc. and the Swift project authors +// Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -274,7 +274,6 @@ class TreeDictionaryTests: CollectionTestCase { d, expectedContents: ref, by: ==) } -#if swift(>=5.6) @available(macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4, *) struct FancyDictionaryKey: CodingKeyRepresentable, Hashable, Codable { var value: Int @@ -290,7 +289,6 @@ class TreeDictionaryTests: CollectionTestCase { self.init(value) } } -#endif struct BoringDictionaryKey: Hashable, Codable { var value: Int @@ -316,7 +314,6 @@ class TreeDictionaryTests: CollectionTestCase { ]) expectEqual(try MinimalEncoder.encode(d2), v2) -#if swift(>=5.6) if #available(macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4, *) { let d3: TreeDictionary = [ FancyDictionaryKey(1): 10, FancyDictionaryKey(2): 20 @@ -326,7 +323,6 @@ class TreeDictionaryTests: CollectionTestCase { ]) expectEqual(try MinimalEncoder.encode(d3), v3) } -#endif let d4: TreeDictionary = [ // Note: we only have a single element to prevent ordering @@ -362,7 +358,6 @@ class TreeDictionaryTests: CollectionTestCase { try MinimalDecoder.decode(v2, as: PD.self), d2) -#if swift(>=5.6) if #available(macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4, *) { let d3: TreeDictionary = [ FancyDictionaryKey(1): 10, FancyDictionaryKey(2): 20 @@ -374,7 +369,6 @@ class TreeDictionaryTests: CollectionTestCase { try MinimalDecoder.decode(v3, as: PD.self), d3) } -#endif let d4: TreeDictionary = [ // Note: we only have a single element to prevent ordering @@ -396,7 +390,6 @@ class TreeDictionaryTests: CollectionTestCase { expectTrue($0 is DecodingError) } -#if swift(>=5.6) if #available(macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4, *) { let v6: MinimalEncoder.Value = .dictionary([ "This is not a number": .string("bus"), @@ -419,7 +412,6 @@ class TreeDictionaryTests: CollectionTestCase { try MinimalDecoder.decode(v7, as: PD.self), d7) } -#endif let v8: MinimalEncoder.Value = .array([ .int32(1), .string("bike"), .int32(2),