@@ -53,19 +53,20 @@ extension OrderedDictionary.Elements.SubSequence {
5353extension OrderedDictionary . Elements . SubSequence {
5454 /// Returns the index for the given key.
5555 ///
56- /// If the given key is found in the dictionary, this method returns an index
57- /// into the dictionary that corresponds with the key-value pair.
56+ /// If the given key is found in the dictionary slice , this method returns an
57+ /// index into the dictionary that corresponds with the key-value pair.
5858 ///
5959 /// let countryCodes: OrderedDictionary = ["BR": "Brazil", "GH": "Ghana", "JP": "Japan"]
60- /// let index = countryCodes.index(forKey: "JP")
60+ /// let slice = countryCodes.elements[1...]
61+ /// let index = slice.index(forKey: "JP")
6162 ///
62- /// print("Country code for \(countryCodes[index!].value): '\(countryCodes[index!].key)'.")
63+ /// print("Country code for \(countryCodes[offset: index!].value): '\(countryCodes[offset: index!].key)'.")
6364 /// // Prints "Country code for Japan: 'JP'."
6465 ///
65- /// - Parameter key: The key to find in the dictionary.
66+ /// - Parameter key: The key to find in the dictionary slice .
6667 ///
6768 /// - Returns: The index for `key` and its associated value if `key` is in
68- /// the dictionary; otherwise, `nil`.
69+ /// the dictionary slice ; otherwise, `nil`.
6970 ///
7071 /// - Complexity: Expected to be O(1) on average, if `Key` implements
7172 /// high-quality hashing.
0 commit comments