Map returns the underlying map. Only call once. Builder is invalid after call. Will panic on second invocation.
()
| 826 | // Map returns the underlying map. Only call once. |
| 827 | // Builder is invalid after call. Will panic on second invocation. |
| 828 | func (b *MapBuilder[K, V]) Map() *Map[K, V] { |
| 829 | assert(b.m != nil, "immutable.SortedMapBuilder.Map(): duplicate call to fetch map") |
| 830 | m := b.m |
| 831 | b.m = nil |
| 832 | return m |
| 833 | } |
| 834 | |
| 835 | // Len returns the number of elements in the underlying map. |
| 836 | func (b *MapBuilder[K, V]) Len() int { |