Refer to the similar API Range:
|
// Range calls f sequentially for each key and value present in the map. |
|
// If f returns false, range stops the iteration. |
|
func (m *TreeMap[K, V]) Range(f func(key K, value V) bool) { |
|
iterator := m.Iterator() |
|
for iterator.Next() { |
|
if !f(iterator.Key(), iterator.Value()) { |
|
break |
|
} |
|
} |
|
} |
Refer to the similar API
Range:loader/pkg/treemap/custom.go
Lines 82 to 91 in 9387b01