30
30
/// of a collection to `MutableCollectionAlgorithms` to get these customization
31
31
/// points to be used from other algorithms defined on
32
32
/// `MutableCollectionAlgorithms`.
33
- public protocol MutableCollectionAlgorithms : MutableCollection
34
- where SubSequence : MutableCollectionAlgorithms
33
+ public protocol MutableCollectionAlgorithms : MutableCollection
34
+ where SubSequence: MutableCollectionAlgorithms
35
35
{
36
36
/// Rotates the elements of the collection so that the element
37
37
/// at `middle` ends up first.
@@ -45,9 +45,9 @@ where SubSequence : MutableCollectionAlgorithms
45
45
46
46
// Conformances of common collection types to MutableCollectionAlgorithms.
47
47
// If rotate was a requirement of MutableCollection, these would not be needed.
48
- extension Array : MutableCollectionAlgorithms { }
49
- extension ArraySlice : MutableCollectionAlgorithms { }
50
- extension Slice : MutableCollectionAlgorithms
48
+ extension Array : MutableCollectionAlgorithms { }
49
+ extension ArraySlice : MutableCollectionAlgorithms { }
50
+ extension Slice : MutableCollectionAlgorithms
51
51
where Base: MutableCollection { }
52
52
53
53
extension MutableCollection {
@@ -380,7 +380,7 @@ extension Concatenation: Collection where Base1: Collection, Base2: Collection {
380
380
}
381
381
}
382
382
383
- extension Concatenation : BidirectionalCollection
383
+ extension Concatenation : BidirectionalCollection
384
384
where Base1: BidirectionalCollection , Base2: BidirectionalCollection {
385
385
public func index( before i: Index ) -> Index {
386
386
assert ( i != startIndex, " Can't advance before startIndex " )
@@ -395,9 +395,8 @@ where Base1: BidirectionalCollection, Base2: BidirectionalCollection {
395
395
}
396
396
}
397
397
398
- extension Concatenation : RandomAccessCollection
399
- where Base1: RandomAccessCollection , Base2: RandomAccessCollection
400
- {
398
+ extension Concatenation : RandomAccessCollection
399
+ where Base1: RandomAccessCollection , Base2: RandomAccessCollection {
401
400
public func index( _ i: Index , offsetBy n: Int ) -> Index {
402
401
if n == 0 { return i }
403
402
return n > 0 ? _offsetForward ( i, by: n) : _offsetBackward ( i, by: - n)
@@ -520,7 +519,7 @@ where Base: BidirectionalCollection {
520
519
}
521
520
}
522
521
523
- extension RotatedCollection : RandomAccessCollection
522
+ extension RotatedCollection : RandomAccessCollection
524
523
where Base: RandomAccessCollection { }
525
524
526
525
extension Collection {
0 commit comments