mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user