MCPcopy Create free account
hub / github.com/benbjohnson/immutable / Last

Method Last

immutable.go:2062–2070  ·  view source on GitHub ↗

Last moves the iterator to the last key/value pair.

()

Source from the content-addressed store, hash-verified

2060
2061// Last moves the iterator to the last key/value pair.
2062func (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

Callers 6

BenchmarkList_IteratorFunction · 0.45
TestSortedMap_IteratorFunction · 0.45

Calls 1

lastMethod · 0.95

Tested by 6

BenchmarkList_IteratorFunction · 0.36
TestSortedMap_IteratorFunction · 0.36