@@ -19,7 +19,7 @@ public struct SortedArray<Element> {
1919 }
2020
2121 /// Initializes the array with a sequence of unsorted elements and a comparison predicate.
22- public init < S: Sequence > ( unsorted: S , areInIncreasingOrder: @escaping Comparator < Element > ) where S. Iterator . Element == Element {
22+ public init < S: Sequence > ( unsorted: S , areInIncreasingOrder: @escaping Comparator < Element > ) where S. Element == Element {
2323 let sorted = unsorted. sorted ( by: areInIncreasingOrder)
2424 self . _elements = sorted
2525 self . areInIncreasingOrder = areInIncreasingOrder
@@ -30,7 +30,7 @@ public struct SortedArray<Element> {
3030 /// This is faster than `init(unsorted:areInIncreasingOrder:)` because the elements don't have to sorted again.
3131 ///
3232 /// - Precondition: `sorted` is sorted according to the given comparison predicate. If you violate this condition, the behavior is undefined.
33- public init < S: Sequence > ( sorted: S , areInIncreasingOrder: @escaping Comparator < Element > ) where S. Iterator . Element == Element {
33+ public init < S: Sequence > ( sorted: S , areInIncreasingOrder: @escaping Comparator < Element > ) where S. Element == Element {
3434 self . _elements = Array ( sorted)
3535 self . areInIncreasingOrder = areInIncreasingOrder
3636 }
@@ -55,7 +55,7 @@ public struct SortedArray<Element> {
5555 /// we only need to re-sort once.
5656 ///
5757 /// - Complexity: O(_n * log(n)_) where _n_ is the size of the resulting array.
58- public mutating func insert< S: Sequence > ( contentsOf newElements: S ) where S. Iterator . Element == Element {
58+ public mutating func insert< S: Sequence > ( contentsOf newElements: S ) where S. Element == Element {
5959 _elements. append ( contentsOf: newElements)
6060 _elements. sort ( by: areInIncreasingOrder)
6161 }
@@ -68,7 +68,7 @@ extension SortedArray where Element: Comparable {
6868 }
6969
7070 /// Initializes the array with a sequence of unsorted elements. Uses `<` as the comparison predicate.
71- public init < S: Sequence > ( unsorted: S ) where S. Iterator . Element == Element {
71+ public init < S: Sequence > ( unsorted: S ) where S. Element == Element {
7272 self . init ( unsorted: unsorted, areInIncreasingOrder: < )
7373 }
7474
@@ -77,7 +77,7 @@ extension SortedArray where Element: Comparable {
7777 /// This is faster than `init(unsorted:)` because the elements don't have to sorted again.
7878 ///
7979 /// - Precondition: `sorted` is sorted according to the `<` predicate. If you violate this condition, the behavior is undefined.
80- public init < S: Sequence > ( sorted: S ) where S. Iterator . Element == Element {
80+ public init < S: Sequence > ( sorted: S ) where S. Element == Element {
8181 self . init ( sorted: sorted, areInIncreasingOrder: < )
8282 }
8383}
0 commit comments