NewSortedMapOf returns a new instance of SortedMap, containing a map of provided entries. If comparer is nil then a default comparer is set after the first key is inserted. Default comparers exist for int, string, and byte slice keys.
(comparer Comparer[K], entries map[K]V)
| 1593 | // If comparer is nil then a default comparer is set after the first key is inserted. Default comparers |
| 1594 | // exist for int, string, and byte slice keys. |
| 1595 | func NewSortedMapOf[K comparable, V any](comparer Comparer[K], entries map[K]V) *SortedMap[K, V] { |
| 1596 | m := &SortedMap[K, V]{ |
| 1597 | comparer: comparer, |
| 1598 | } |
| 1599 | for k, v := range entries { |
| 1600 | m.set(k, v, true) |
| 1601 | } |
| 1602 | return m |
| 1603 | } |
| 1604 | |
| 1605 | // Len returns the number of elements in the sorted map. |
| 1606 | func (m *SortedMap[K, V]) Len() int { |
nothing calls this directly
no test coverage detected
searching dependent graphs…