Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/public/core/DiscontiguousSlice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ extension Collection {
///
/// let str = "The rain in Spain stays mainly in the plain."
/// let vowels: Set<Character> = ["a", "e", "i", "o", "u"]
/// let vowelIndices = str.subranges(where: { vowels.contains($0) })
/// let vowelIndices = str.indices(where: { vowels.contains($0) })
///
/// let disemvoweled = str.removingSubranges(vowelIndices)
/// print(String(disemvoweled))
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/MutableCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/RangeReplaceableCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ extension RangeReplaceableCollection {
///
/// var str = "The rain in Spain stays mainly in the plain."
/// let vowels: Set<Character> = ["a", "e", "i", "o", "u"]
/// let vowelIndices = str.subranges(where: { vowels.contains($0) })
/// let vowelIndices = str.indices(where: { vowels.contains($0) })
///
/// str.removeSubranges(vowelIndices)
/// // str == "Th rn n Spn stys mnly n th pln."
Expand Down Expand Up @@ -1216,7 +1216,7 @@ extension MutableCollection where Self: RangeReplaceableCollection {
/// numbers in the array, and then removes those values.
///
/// var numbers = [5, 7, -3, -8, 11, 2, -1, 6]
/// let negativeIndices = numbers.subranges(where: { $0 < 0 })
/// let negativeIndices = numbers.indices(where: { $0 < 0 })
///
/// numbers.removeSubranges(negativeIndices)
/// // numbers == [5, 7, 11, 2, 6]
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/RangeSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// locations of all the negative values in `numbers`:
///
/// var numbers = [10, 12, -5, 14, -3, -9, 15]
/// let negativeSubranges = numbers.subranges(where: { $0 < 0 })
/// let negativeSubranges = numbers.indices(where: { $0 < 0 })
/// // numbers[negativeSubranges].count == 3
///
/// numbers.moveSubranges(negativeSubranges, to: 0)
Expand Down