Skip to content

Commit c880918

Browse files
committed
Remove risky default argument values.
All values for `indexForSubsequence` arguments are now explicit at call sites.
1 parent db64440 commit c880918

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Sources/Algorithms/LazySplitCollection.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ public struct LazySplitCollection<Base: Collection> {
5858
}
5959
} else {
6060
/// 3. `base` isn't empty, so we must iterate it to determine the start index.
61-
_startIndex = indexForSubsequence(atOrAfter: base.startIndex)
61+
_startIndex = indexForSubsequence(
62+
atOrAfter: base.startIndex,
63+
sequenceLength: 0,
64+
separatorCount: 0
65+
)
6266
}
6367
}
6468
}
@@ -97,8 +101,8 @@ extension LazySplitCollection: LazyCollectionProtocol {
97101
/// Returns the index of the subsequence starting at or after the given base collection index.
98102
internal func indexForSubsequence(
99103
atOrAfter lowerBound: Base.Index,
100-
sequenceLength: Int = 0,
101-
separatorCount: Int = 0
104+
sequenceLength: Int,
105+
separatorCount: Int
102106
) -> Index {
103107
var newSeparatorCount = separatorCount
104108
var start = lowerBound

0 commit comments

Comments
 (0)