1
1
//
2
2
// CryptoSwift
3
3
//
4
- // Copyright (C) 2014-
2021 Marcin Krzyżanowski <
[email protected] >
4
+ // Copyright (C) 2014-
2022 Marcin Krzyżanowski <
[email protected] >
5
5
// This software is provided 'as-is', without any express or implied warranty.
6
6
//
7
7
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -19,12 +19,12 @@ struct BatchedCollectionIndex<Base: Collection> {
19
19
20
20
extension BatchedCollectionIndex : Comparable {
21
21
@usableFromInline
22
- static func == < Base > ( lhs: BatchedCollectionIndex < Base > , rhs: BatchedCollectionIndex < Base > ) -> Bool {
22
+ static func == < BaseCollection > ( lhs: BatchedCollectionIndex < BaseCollection > , rhs: BatchedCollectionIndex < BaseCollection > ) -> Bool {
23
23
lhs. range. lowerBound == rhs. range. lowerBound
24
24
}
25
25
26
26
@usableFromInline
27
- static func < < Base > ( lhs: BatchedCollectionIndex < Base > , rhs: BatchedCollectionIndex < Base > ) -> Bool {
27
+ static func < < BaseCollection > ( lhs: BatchedCollectionIndex < BaseCollection > , rhs: BatchedCollectionIndex < BaseCollection > ) -> Bool {
28
28
lhs. range. lowerBound < rhs. range. lowerBound
29
29
}
30
30
}
@@ -48,27 +48,27 @@ struct BatchedCollection<Base: Collection>: Collection {
48
48
typealias Index = BatchedCollectionIndex < Base >
49
49
50
50
private func nextBreak( after idx: Base . Index ) -> Base . Index {
51
- base. index ( idx, offsetBy: size, limitedBy: base. endIndex) ?? base. endIndex
51
+ self . base. index ( idx, offsetBy: self . size, limitedBy: self . base. endIndex) ?? self . base. endIndex
52
52
}
53
53
54
54
@usableFromInline
55
55
var startIndex : Index {
56
- Index ( range: base. startIndex..< nextBreak ( after: base. startIndex) )
56
+ Index ( range: self . base. startIndex..< self . nextBreak ( after: self . base. startIndex) )
57
57
}
58
58
59
59
@usableFromInline
60
60
var endIndex : Index {
61
- Index ( range: base. endIndex..< base. endIndex)
61
+ Index ( range: self . base. endIndex..< self . base. endIndex)
62
62
}
63
63
64
64
@usableFromInline
65
65
func index( after idx: Index ) -> Index {
66
- Index ( range: idx. range. upperBound..< nextBreak ( after: idx. range. upperBound) )
66
+ Index ( range: idx. range. upperBound..< self . nextBreak ( after: idx. range. upperBound) )
67
67
}
68
68
69
69
@usableFromInline
70
70
subscript( idx: Index ) -> Base . SubSequence {
71
- base [ idx. range]
71
+ self . base [ idx. range]
72
72
}
73
73
}
74
74
0 commit comments