func (m *SortedDictionary[KT, VT]) Set(k KT, v VT) {
	m.lock.Lock()
	defer m.lock.Unlock()
	if m.items == nil {
		m.items = make([]sortedDictionaryItem[KT, VT], 0)
	}
	if len(m.items) == 0 {
		m.items = append(m.items, sortedDictionaryItem[KT, VT]{k, v})
		return
	}
	x, ok := m.search(k)
	if ok {
		m.items[x].val = v
		return
	}
	// add at x
	if x == len(m.items) {
		m.items = append(m.items, sortedDictionaryItem[KT, VT]{k, v})
		return
	}
	m.items = append(m.items[:x], append([]sortedDictionaryItem[KT, VT]{{key: k, val: v}}, m.items[x:]...)...)
}
// Set sets a key=value pair in the map.
Set sets a key=value pair in the map.
// Set sets a key = value pair in the map .
func (m *SortedDictionary[KT, VT]) Set(k KT, v VT) {
	m.lock.Lock()
	defer m.lock.Unlock()
	if m.items == nil {
		m.items = make([]sortedDictionaryItem[KT, VT], 0)
	}
	if len(m.items) == 0 {
		m.items = append(m.items, sortedDictionaryItem[KT, VT]{k, v})
		return
	}
	x, ok := m.search(k)
	if ok {
		m.items[x].val = v
		return
	}
	if x == len(m.items) {
		m.items = append(m.items, sortedDictionaryItem[KT, VT]{k, v})
		return
	}
	m.items = append(m.items[:x], append([]sortedDictionaryItem[KT, VT]{{key: k, val: v}}, m.items[x:]...)...)
}
func ( m * SortedDictionary [ KT , VT ] ) Set ( k KT , v VT ) { m . lock . Lock ( ) defer m . lock . Unlock ( ) if m . items == nil { m . items = make ( [ ] sortedDictionaryItem [ KT , VT ] , 0 ) } if len ( m . items ) == 0 { m . items = append ( m . items , sortedDictionaryItem [ KT , VT ] { k , v } ) return } x , ok := m . search ( k ) if ok { m . items [ x ] . val = v return } if x == len ( m . items ) { m . items = append ( m . items , sortedDictionaryItem [ KT , VT ] { k , v } ) return } m . items = append ( m . items [ : x ] , append ( [ ] sortedDictionaryItem [ KT , VT ] { { key : k , val : v } } , m . items [ x : ] ... ) ... ) }
Set sets a key=value pair in the map.
Set sets a key = value pair in the map .
// add at x