Skip to content

Commit

Permalink
Fix typos: missing subscript parameters (apple#81)
Browse files Browse the repository at this point in the history
* Fix typos: missing subscript parameters

* Fix typos: more missing subscript parameters

* Improve symbol documentation
  • Loading branch information
ejmarchant authored and lorentey committed Aug 19, 2021
1 parent 0959ba7 commit 9bf46d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,20 @@ extension OrderedDictionary.Elements.SubSequence {
extension OrderedDictionary.Elements.SubSequence {
/// Returns the index for the given key.
///
/// If the given key is found in the dictionary, this method returns an index
/// into the dictionary that corresponds with the key-value pair.
/// If the given key is found in the dictionary slice, this method returns an
/// index into the dictionary that corresponds with the key-value pair.
///
/// let countryCodes: OrderedDictionary = ["BR": "Brazil", "GH": "Ghana", "JP": "Japan"]
/// let index = countryCodes.index(forKey: "JP")
/// let slice = countryCodes.elements[1...]
/// let index = slice.index(forKey: "JP")
///
/// print("Country code for \(countryCodes[index!].value): '\(countryCodes[index!].key)'.")
/// print("Country code for \(countryCodes[offset: index!].value): '\(countryCodes[offset: index!].key)'.")
/// // Prints "Country code for Japan: 'JP'."
///
/// - Parameter key: The key to find in the dictionary.
/// - Parameter key: The key to find in the dictionary slice.
///
/// - Returns: The index for `key` and its associated value if `key` is in
/// the dictionary; otherwise, `nil`.
/// the dictionary slice; otherwise, `nil`.
///
/// - Complexity: Expected to be O(1) on average, if `Key` implements
/// high-quality hashing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ extension OrderedDictionary.Elements {
/// into the dictionary that corresponds with the key-value pair.
///
/// let countryCodes: OrderedDictionary = ["BR": "Brazil", "GH": "Ghana", "JP": "Japan"]
/// let index = countryCodes.index(forKey: "JP")
/// let index = countryCodes.elements.index(forKey: "JP")
///
/// print("Country code for \(countryCodes[index!].value): '\(countryCodes[index!].key)'.")
/// print("Country code for \(countryCodes[offset: index!].value): '\(countryCodes[offset: index!].key)'.")
/// // Prints "Country code for Japan: 'JP'."
///
/// - Parameter key: The key to find in the dictionary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ extension OrderedDictionary {
/// let countryCodes: OrderedDictionary = ["BR": "Brazil", "GH": "Ghana", "JP": "Japan"]
/// let index = countryCodes.index(forKey: "JP")
///
/// print("Country code for \(countryCodes[index!].value): '\(countryCodes[index!].key)'.")
/// print("Country code for \(countryCodes[offset: index!].value): '\(countryCodes[offset: index!].key)'.")
/// // Prints "Country code for Japan: 'JP'."
///
/// - Parameter key: The key to find in the dictionary.
Expand Down

0 comments on commit 9bf46d8

Please sign in to comment.