[stdlib] Fix doc comment refs to subranges(where:), now called indices(where:) (#78512)

Doc comments for DiscontiguousSlice, MutableCollection, RangeSet, and
RangeReplaceableCollection all refer to a Collection method subranges(where:)
which is intended to return a RangeSet of matching ranges. I believe this is
likely an old or formerly-contemplated spelling of the method now known as
indices(where:). This commit changes "subranges" to "indices".
This commit is contained in:
Garth Snyder
2025-01-16 13:54:02 -08:00
committed by GitHub
parent 452302e3b9
commit 610d07e9ed
4 changed files with 5 additions and 5 deletions

View File

@@ -377,7 +377,7 @@ extension MutableCollection {
/// moves them to between `"i"` and `"j"`.
///
/// var letters = Array("ABCdeFGhijkLMNOp")
/// let uppercaseRanges = letters.subranges(where: { $0.isUppercase })
/// let uppercaseRanges = letters.indices(where: { $0.isUppercase })
/// let rangeOfUppercase = letters.moveSubranges(uppercaseRanges, to: 10)
/// // String(letters) == "dehiABCFGLMNOjkp"
/// // rangeOfUppercase == 4..<13