Last moves the iterator to the last key/value pair.
()
| 2060 | |
| 2061 | // Last moves the iterator to the last key/value pair. |
| 2062 | func (itr *SortedMapIterator[K, V]) Last() { |
| 2063 | if itr.m.root == nil { |
| 2064 | itr.depth = -1 |
| 2065 | return |
| 2066 | } |
| 2067 | itr.stack[0] = sortedMapIteratorElem[K, V]{node: itr.m.root} |
| 2068 | itr.depth = 0 |
| 2069 | itr.last() |
| 2070 | } |
| 2071 | |
| 2072 | // Seek moves the iterator position to the given key in the map. |
| 2073 | // If the key does not exist then the next key is used. If no more keys exist |